fiq_fsm: fix several bugs