fixed some bugs introduced in the merge script due to changes in output naming.