Fixed all bugs in loading and saving graph.