fix structured and batch mode.  Add constant to disable batch mode by default