Improvement: resolve bad behavior in multi-match cases