Fix calls to Rand() and test_data_layer error