Adapt to Mac OS X