Fix bug on having duplicates given both partitions