Fixed issue where clean shutdown of service discovery app caused services to become unregistered.