[ET Trac] #2517: LoopControl uses RAND_MAX as the range for random(3)