This fixes #2759 in maintenance-3.x