Remove unnecessary fsm.
Fix bad pattern match.