Avoid duplicate clauses in distinct