Fix a bug with multiple matching