Fixes to Sparse_matrix class