fix handling of multiple input files