Changes to support build on Mac OS X