fix some bugs when generating inter-automaton