Fix some issues that cause security errors on https