This fixes #2759 in maintenance-3.x

Fixes #2759