Fixes for graceful exit patch

Mostly avahi related and cosmetic fixes for the graceful exit patch.