Fixed usage of ProviderContext.
Other fixes.