Fix issues when processing multiple input files.