Various provisioning fixes for mainline. Minor bug fixes while testing mainline