Quick and dirty fix for pathfinding out of bounds.