Fixed error in random()