Modified the generation of entiry Ids.