Some fixes for Clang/OS X

Some fixes that make the wrapper build on OS X. There should be no impact on current Linux build.