C++ fixes and profiling