Cleaned up pathfinding out of bound exception fix.