Fixed some cross-build issues