Added support for gz input files