I had this problem also updating to 4. I tried to solve it looking why, because I use the template in more than one site and more than one hoster. At one hoster its a problem, at another hoster it is not.
I do think the problem is in the top an bottom_css_and_js_compression.php.
$_SERVER['REQUEST_SCHEME'] = ($_SERVER["HTTPS"] == 'on') ? 'https' : 'http';
does not work the same for every installation (hoster).
I found that even installing in a subdomain (HTTP) under a domain (HTTPS) is giving problems.
I am not a programmer , but why don't you use the variable $force_ssl from the configuration.php to decide if it SSL or not?