Fixed a bug where AI could get stuck on a node

Fixed a bug where AI could get stuck on a node if only two nodes were in
its populated node list.