c++ fixes for clang