Fixes bug #836
Merge pull request #837 from ClemRz/bug-834

Fixes bug #836