Made debug mode a setting