https support and bug fixes