Fix 400/500 https issues