Fixed issue with minibatches.