Fixes for OSX
Merge pull request #800 from lionello/osx

Fixes for OSX