Fix a state transition bug around OSC teminator