Added an error state in the automata implementation.