The rand is reinitialised when it can just use the outer one.

The rand is reinitialised when it can just use the outer one.