fixes to inconsistencies to global names in prepare_data portion