Fix off-by-one in board limit check

I believe I found a small bug in the To function while implementing my pathfinding algorithm.
Position on the board should stay between 0 and (size-1).