Fix bug saving using MasterKey