Fix ArrayIndexOutOfBoundsException in CommandHelper