Fixes problem where duplicates aren't being combined

Fixes #1