Fix multi-input file merge