Fixes to dynamic variable handling.

Brings things inline with other backends, fixing the bug affecting
32-protoregex.t.