Fixed bug occurring when node is not in graph