Use rand() instead of random() in regression tests.