Added random data generator for testing.
Corrected typo in constants.