OSX fixes
Merge pull request #6 (OSX fixes) from devernay; thanks!