more fixes for gpg format (issue #472)

For review purposes. Please do *NOT* merge yet.