Fixed several issues in PersistenceManager