Handle deactivation.