Backport pull request 4115