Some improvements on the DTLS handshake (and related debugging)