Fix bug for graph.c