Improved setundef random number generator