bug fixes to NN methods