Got rid of most of the debugging code in extend_match_with_res