cpp: attempt to fix clang errors