Fixed some bugs with the ad and SSL