Fix building on OS X Yosemite

Some C++ stuff changed with the Yosemite update; this should hopefully resolve those with minimal hassle and without breaking older on older Mac OS X versions.