MAC-OS: Fixed issues to make it work on MAC-OS.
Merge pull request #2 from dporro/mac-os

MAC-OS porting