#1025 backport