Small ArrayIndexOutOfBoundsException fix