Fixed foreign key relationships