Make debug mode a parameter, not a setting