Fixed a bug that caused the program to hang or crash if the device is disconnected during sync.