bug fixes for PGP