Add toString to ProviderQuery
Fix NPE getting to statistic names

Also throw the error from the promise if it happens