Minor changes to make it build on OSX