Fix assertions in test_matcher
Refactored segments