Some fixes for mac with clang build