Fixes for building on OSX
Merge pull request #373 from yamamushi/develop

Fixes for building on OSX