Reformatting and commenting
Fixing GPG error handling to deal with resource starvation