Fix random number usage for non-standard browsers