Added envelopeTo and envelopeFrom support