Added check on externalptrs.