Fix duplicates in output