fix issue with rand_* not accounting for user stupidity.

Namely, a user accidentally passing a non-numeric/non-integer argument in as n and watching their session segfault.