Fix a ToOneLookup issue where the owningClass for the field may be set to an incorrect value