Implements #979
Merge pull request #982 from emmanuel-keller/master

Implements #979