Fixed build errors on OSX