Fix bug that mutated the qualifier type when there were common prefixes.