Corrected several tests, and refactor the initialization of the provider
out of the constructor to a separate init method... ugly but required
for being able to spy the object.