Fixed issues with the Mac OS X code