Issue #1370: Add a test
Fix #1370
Fix #1371
Issue #1371: Add a test.