Fix C++ compilation problems on OS X Mavericks