fix logical error in MCMatch::eval_ctxt
refactored MCRepeat