Merge pull request #241 from fabienrohrer/master

Improved code robustness