Fix issue in threshold_set_state.