Fix possible GetNfactor() overflow