Fixed and tested OSX build