Added calculation of average error on the output nodes.