text_reader.fsm: fix the state transitions