Modified the code to support OS X development environment

Just did some tiny modification for OS X development compatibility and code are tested successfully.