Fixing bugs in copy and move methods