Fixed bug for entities with ID = 0