Resolve compilation error in Automata.scala.  More refactoring should be done to maintain since most codes are translated from Java automatically.