Merge the cli_shutdown change from 2_2. All except one call to