Fix setting foreign key on belongsTo

This should actually fix #353