various fixes for build env