Replace DebugMode hack with equally dirty config