Merge "Revert "Revert "Fix the computation of linear ordering."""