Merge "Fix ArrayIndexOutOfBoundsException." into lmp-dev