Implements #1035
Merge pull request #1038 from emmanuel-keller/master

Implements #1035