minor fixes to work with c++