some fixes to graph.py