Cleanup do_state_checks