Backported the fix I had made in third_party.