Watch for negative value in batch size and don't use it when creating result array.

Also some missed files from previous commit