fixed pathfinding and rounding errors