Remove scoped variables that are no longer used.