Latest code update and fixes to FSM