Re-apply this patch which was accidentally deleted: