Fix bug for Mac OS X