further improvements to patches and build process