Fix tests and entity creation.