Small changes to EntityManager.