semantic: Correctly check scope.