Improved ScopeRegistry (possible to remember last scope and re-set it),
generated lazy value support code removed when unnecessary