key_commit: Fixed a bug found in testing