Fixing sorting of wired dependencies