Backports the fix for TAP5-1718 to 5.3.x