Various improvements to build process