apply xtype test to the keyfield duplication handling.
Authored by: SeanZ 2012-05-31
Parent: [r6220]
Child: [r6222]