fixed some bugs of perceptron.js