Fixed disconnect handling.