Another try
Fix clean up and allow key archival
More failure checking