submatrix type bug fixed