Fix ExternalReferenceWriter.