Fixes to build scripts