Remove duplicate ids. Fixes #151.