Fixed compilation errors under osx xcode, mavericks