python to c++ fixes