Adjusted to changes in context scoping.