Report disconnected status more reliably
Better error checking and recovery
Code cleanup