fixed test regressions by clearing config and certain environment variables before tests