BUG: Fixed bugs resulting from changing gen_rand_data interface.