Fixed foreign key for "has one" relationships.