Remove duplicates in external literals.
Remove unused variables in the first call.