Fix race conditions for self-dependent matchers