fix bug with flag_i handling.