Added fault tolerance to the envelope parser.