Handle null foreign key values