Change condition on type of random
Minor changes