Fix #317
Merge pull request #318 from rlouapre/issue-317

Fix #317