(cherry picked from commit 8ad921dc942b43b8f6ccec529834649585ef0df1) Fast-forwarded to get to master sooner.