cleanup code
fix build of C++ compiler debug version