More fixes for finding number of providers.
Fix for query Receive threading.