Fixes for test behavior, bugfix in DiscoveryService.