Fixed bugs and improved HTTP/HTTPS