Make the check for gzipped format safer.