P. Thoyts came up with a patch for this: