Fixed infinite loop when attempting to find a path between two
disconnected nodes.