Fix bug on OS X platform.