Improvements to the build system