Fixed some issues with cross-building