Backported from RCPTT

RCPTT commit: 378ee7a836b832b48bac915653a0c9c89527190a