output formatting, env var scope fix in tests