Improve unit tests for random variables.