Fix merging a bit by using sets instead of lists when comparing.