Fixed some issues with on HTTPS