Fixed scoping and tests: double scope invalidation on text change.