fixed some encoding problems with gzip/zlib and lzma