Patch from RT #18476 applied with some hunk failures