Fixed bugs in the dynamic duplication logic

Fixed some cases where the original values were copied to the duplicated fields.