Fixed duplicate column detection in insert and update