Fixed issue with random number generator.