bugfixes for gzipped input