Add dynamic scoping to macros