fix & some more tests for EntityManager