Fix gzip header issue

Fixes #369