Fix errors on both protocol and WhatsApp connection losses