Fix RandomScoreFunctionTests to be more reproducible.