Actually delete invalid relationships on duplicate. Fixes #17