build.sh: misc fixes