#40 Fixed EntityManager creation related bug