restore Federico's fix for batch sizes, since it previously was reverted from 27.0.2 because of missing test