Better disconnect handling and timeouts.