Better handling of connection failures/reconnects