[entity-manager.cpp and .h] fixed breakages