Fix a bug in the C++ tests