Issue #1717: Add tests
Fix #1717.