Fix mixed http/https handling

- See http://www.zeyalabs.ch/posts/2010/stray-quotes-z/#comment-16646