More improvements to the random number generator