Misc fixes.

Hi! Thanks for Arcane.

  While using this tool to decrypt a maildir (to be able to use http://www.djcbsoftware.nl/code/mu/ on it) I ended up writing the changes in this pull request. This will probably be useful to others too.

Best Regards,
 igorhvr