fix some matching problems