Improved code robustness
Merge pull request #241 from fabienrohrer/master

Improved code robustness