Adopted to new random generator interface.