fix check on whether a global is external; fixes issue #24