Fix sorting order of directory creation