Fixed bug with directory resolution and added batch mode to gpg.