Added check for public inheritance in makeEntity.