Fix envelopes, https://github.com/rec/echomesh/issues/411 and unit tests.