fix build issues and split build.