Fix the macro subsystem

It is still a little unreliable, but at least it now *mostly* works!