Fix problems with clang build on osx