Minor changes in implementation of randomness