Fixed bug with multilayered neural networks