Fixed a few bugs and errors. Also added gzip compression to requests.