Fixed bug in CopyData