Fixing forms to ensure correct insert/update and deletes