Made envelope variant-aware.

[SVN r86531]