Fix up errors in buildscript and other random work