Some OSX fixes and fix clang warning.