Further improvements to build script