Improve C++ compatibility