Fixed bug with registering duplicate EntityManager templates