Add missing cast for C++