Added some C++ functions.