Add more logging; encode nonce