There are currently several inescapable loops in the FSM. I need to identify these and add in the appropriate error handling.