output formatting, env var scope fixes in tests