Saving foreign key switches create/update

Issue #7