Fix bug in yr_re_exec logic