Fix var linking in imports

When an original var is redefined, imported var should point to the new
value of the var, not the var itself.