Fixed a bug in nnTraining