Adapting latest changes in data_generation_revision branch