Couple of fixes to state machine.