mtac2: add checks in [refine] so we only accept candidates whose type matches the expected one