Fix #1102, implements #716
Merge pull request #1112 from emmanuel-keller/1.6

Fix #1102, implements #716