Fixed theano function bug