Fix error returns on openpgp backend.

Also fix:
  - some docstrings.
  - variabled referenced without previous assignement.