Fixes to build on OSX 10.9