Fix magic path sorting.