Error function support added for NNs.