Removed uneccessary code in EntityRegistry.