Fixed a potential error serving scripts over HTTPS