Fixed the random number generation always giving the same value.