More robust smart quit.