Fix bugs in build scripts.