Bug fix for issue #55

This should fix issue #55 (bug in TopologicalOrderIterator). A few additional tests are included to verify the solution.