Fixed problem with always initializing provider.

- Bug introduced in 901d8e431a5f0665ff89078d3e646b68b39cb3ce
- See issue #39