Fix state machine callbacks