Fix entity creation