Add unit test
Rename local variable in generated code

closes #197