Fix https bugs