Major bugfix for entities IDs.