Added support for gzip-ed or bzip2-ed output files.