Fix writing content to GZIP file