Fix HTTPS detection