Fixed bug that caused non-entity objects to be added to the persistence JS session.