Fix incorrect scoping for variable  and