Fixed a bug with incrementing the positions of current and resind in extend_match_with_res.  Now for at least the first segment, extend_match_with_res does not segfault.