Bugfix involving graph building