Fix batch size check