fix some cross-build and integration problems