CXX compatibility fixes