Fix errors with SSL / non ssl