Deal with the fact that the directory order of paths is unstable.
More coping with sort order instability.