Some fixes suggested by @pkakelas and @kargig
Merge pull request #41 from gtklocker/ssl_fixes_2

Some fixes suggested by @pkakelas and @kargig