Correctly format envelope from string