Fixed issue with non-ordered input files