Fix random number generator method

Signed-off-by: Jorge Ruesga <jorge@ruesga.com>