merge 2.10.1 into 2.10.x

Includes some commit that clean up the patmat refactoring a bit,
and a separate forwardport (in 2cf6c5d) of the fix for SI-7183 (original in 0303e64).