Build osx

Hi, these are a few patches to ease the build on Mac OSX and remove a few clang warnings.