Fixing extract classs bugs, make sure to generate c++ style code