fixes to NMF procedure