Fix problem with overlapping variable names in generated code