Fixed bugs, including packet length bug in openpgp

Also fixed smtp_client bug (extra template arg)