Improved error handling when doing KJChessBoard.getPiece