Fix bugs in the header that SWIG will use to generate the c++ code