backport #1748