Fix #1874.
Issue #1874: Add a test