Fixed double save of keys

Closes #107