Small fixes to dijkstra
DM implementation of the fdnf