Backport fix for #2508 into 2.2-stable

This is pointless because it will never be released, but people won't stop complaining.