Fix error returns on openpgp backend.

Also fix:
  - some docstrings.
  - variabled referenced without previous assignement.
Merge remote-tracking branch 'drebs/bug/fix-error-returns' into develop