Added DEBUG global setting. Used in generate_exception_report