Improve exception messages and speed for label matching