Fix gzip response writing