Fixed a bug in the types of a sparse matrix