Added two patches suggested by Pierre and Arjun to fix an issue with service dependencies that use a filter, where the filter can return services that are of a different type than the specified type. Also added some logging.