fixes to MNIST scripts