Added https support and some small fixes