Try to handle connection loss a little bit nicer.