Fixed many bugs in PersistentSparseMatrix class