Switch to rand() instead of Array#sample, for random seed portability