Multiple bugfixes for provider code