fixed checking if node is in grid in NodeGrid::routeHeading