fix a few bugs in provisioning scripts