Fixed C++ issues