Fix #1317
Issue #1317: Add a test
Issue #1317: Uncomment part of test.
Issue #1315: Add a test
Improve some doc
WIP