Updted client lib to handle disconnecting endpoints better.