.mat column-major order bug fix