Corrected some problems with neural networks