Resolve unique constraint errors