Added equal kernel and fixed a bug in MNIST test.