Fixed bug for items.size()<100 and better batch handling