Fix build.sh bugs.