Fix #1857
Issue #1857: Add a test