Small changes to state machine