Fixes to build script