Fix for calculating batch size.