BatchMixin: do not allow setting invalid batch size