Added code for reversing extensions in calls to extend_match_with_res when the direction of the coarse sequence is reversed