fix up patches and build process