ledger doesn't save the header of the message, also fixing corner cases