Fix key updates when local copy has changed.
Merge pull request #6 from frgtn/fix_key_update_with_local_changes

Fix key updates when local copy has changed.