Bug 874948 - Fix string rooting hazards in matching code, r=terrence