RNG bug fix