register local variables before macroexpansion, fixes #3