Fix https://github.com/rec/echomesh/issues/501 and https://github.com/rec/echomesh/issues/502