PersistentMap fixes and test improvements