gzip/deflate support and some other minor fixes