Changes to compile on Mac OS X