fix a bug uncovered by  1b3fd890adb725

Merge to 6.1, please