Safer iteration functions #551
#dijkstra throws error if root/target element doesn't exist #550