Various fixes for clang