Fixed build issues on OSX