Bugfixes to provisioning