[NTG-context] some bugs and C++ typing