Issue #2501 was partially fixed (without tests).