#1346: fix macro running after metadata refresh
Merge pull request #1384 from benfitzpatrick/1346.macro-problem-metadata-refresh

#1346: fix macro running after metadata refresh