A few changes to make generated code actually compile.