fix final states and some structures
fix stateid masks
work on fix traverser