Fixed bug that it would neglect to collect the last item in a batch because of a simple logic error.