C++ mode fixes