some bug fixes to truth matching
merge with FixTruthMatching to fix minor truth matching bugs