Remove debug traces, inline matrix index function