Revert "Fixed bugs on Mac OS X"

This reverts commit 46fa56607f264a88c94b8a581700ed1f8ba5d12b.