Some fixes to build scripts.