Dedup corner cases. Fixes #5 Fixes #6