Fix error where multiple files at would be handled incorrectly.

When there are multiple files at the same level the path needs to be
reset on each iteration. Failing to do so causes adjacent files to be
nested incorrectly.