Fix isExternal logic.