Fix some HTTPS errors and some bugs.