ExternalRef bugfix