Fix #1102, implements #716
Merge pull request #1111 from emmanuel-keller/1.5

Fix #1102, implements #716