Prevent TileTouch from exceeding end of matrix