Fix build.sh and preinstall scripts.