fix intermediate directory names