Make BatchCombiner sort by (type, layer) instead of just type so that it can efficiently combine more batches.