Fixed some stuff in CNI.cpp