Some changes to dup()