Backporting commit 1f39650