Fix ArrayIndexOutOfBoundsException on SRAM