Fix dynamic scoping