Fixed some issues when building with Xcode.