Fix for EntityManager