Fixed bug: ArrayIndexOutOfBoundsException