fixes for c++ compiling