Fix linkage on external variables

Externals should be passed around byval.