Fixed glitch where entities would become detached from the persistence context during runtime.