Fix JS variable renaming bug