Handle remote disconnect properly.