A few hacks to get this compiling under OS X.