Fix #122 TypeError: redeclaration of variable