Patch for Mac OS X compat