bugfix in scope tracking of variables in CodeHandler