Enhance test reliability
Merge pull request #227 from njoyard/fix-tests

Improve test reliability