Fix bug in SimpleGraph.