Fixed bug in copy