fixed a bug in test_matching.py