NN: minor fix in cost function