Revert "restrict RandIntGen to generate random numbers in the interval [1,n]"

This reverts commit ea2bd4b9d5fa3880f461f6ceac1e559c5fd8b6af.
Fix #8566