Added compression support, bug fixes