Fix test crash in DebugMode. We make the toposort of the same type as all other places.

It was a set, not it is now a list. This cause problem in the error handling code where we try to get the index in a set. That isn't defined.
Update comment.