Fix copying back from device