Fix duplicates in graph