treemerge: make traverse safer; be very strict on errors.