Fix device selection bug
If device pref 1 and 2 are both disconnected and the user connects device 2, it would take preference over device 1. The fix is to remember the index of the disconnected device when saving it