Avoid some redundant states in automata construction.