Issue #2278247 by torotil, katomat: Fix handling of unique fields.