improve label merging: ignore additional label matches when a
match has already been found (i.e. always keep the first match).