fixes lookup and reading gzip headers