optimize pathfinding a bit, small pylint fixes