Fixed a bug in the Graph class.