Fixed http/https detection