The suggested changes have already been included in v5 patch. Sorry for the confusion.
Verified that the patch still applies and works on latest master. So I'm moving it to the next CF (which is Commitfest 2022-01). Please correct me if this is not the right thing to do.
Rebased the patch with latest master. Appreciate any comments.