Merge "improvements to the batch mode APIs"