Fixed bug with wrong neighbor distance in Graph.