Correcting dependency ordering