Bug fixes for provider refactoring