Fixed ArrayIndexOutOfBoundsException