Changes for compiling on Mac OS X