Fix Error where unrestricted local variable is incorrectly identified as a global variable