fix some bugs in dfa