Fixed warning and errors in xcode builds.