Made the test more in line wiht standards (using theano functions)