BUG: Variable in the wrong scope.