Fix random number generation.
Merge branch `benchmarks` into `master`.