fixed leak for very small batch sizes