Fix rook mask at the edges of the board