Fix resources.addToPath to consider priorities.