Fix test for topological sort