Changed Rand() to use unix and win32 envvars.