Forward-port of recent spray patches

This PR aggregates a number of patches that we have applied to spray this week.
I thought about that, but this matcher should be used quite rarely, which is why I opted for the simpler (and shorter) uncached variant.