Fix foreign key update, see #9