Script fixes, discovered while building on dev.medicmobile.org.