corrects reference to square in Position.countLegalMoves