Patch 3.7 upgrade -- cherry pick after env_support is merged