Correcting ordering of dependencies