fixed bugs in testNeuralNetwork