Leaf dirs are not processed correctly - fixed