Fixed Tree topological sort.