[Resolution] Make sure to sort dependencies for the initial state