Added some checks to make sure the requred values are set before generating the psuedo-random data.