Fix canonicalisation of matchers (see new tests)

@nguyenchr ?