Fixed copyInstance bugs