Fix shortest path retrieval by adding nodes rather than edges.