Fix for Exception in InMemoryRSPersistence and in RSJPAPersistence