Added environment stack creation.