Fixed the out of bounds exception when rotated piece is on the top part of the board.