Fix C++ compilation error