Switch arguments to flattenEnvironments.