WIP: some FSM fixes