Fixed a bug where erasing an entity causes a skip in iteration of some entities. Now entities get erased after the logic update is finished.