Fixed bug when checking both http and https
Minor bug fixes