Added OSX compatibility.
Fixed linux's type conversion functions.
Merge pull request #2 from abecciu/osx-compat

Added OSX compatibility