fix a few matching bugs