AUTO-577 set rand() max to 1 less than array size, since arrays are 0 based