Fixes on the random generator