Some routines to help with randomness.