This turned into more work than I expected, as I kept finding performance glitches and/or correctness bugs in the neighborhood. I installed the attached set of patches. Patch 03 is the crucial one. Patch 10 trivially fixes an earlier test of mine and I'm too lazy to write a separate email for it. This fixes the problem for me, so I'm taking the liberty of closing this bug report.