Minor changes to C++ code