Fix gzip and chunked transfer