Rename tmp_flag => d_tmp_flag