Fixed ArrayIndexOutOfBounds Exeption.