I've pushed this patch to master, since it's been more than two weeks and I'm confident of its correctness.