Fix a bug in isMatch().