Further changes to EntityManager