Fix: computation of submatrix dimension