Fixing issues with overlapping output directory names.