Implements issue #561
Merge pull request #564 from emmanuel-keller/master

Implements issue #561