A bunch of stability fixes to do with connectivity, network and leaving apps.
Merge remote-tracking branch 'origin/master'