PersistentMap improvements and bugfixes