Implements #589
Merge pull request #594 from emmanuel-keller/master

Implements #589