fix tests
Merge pull request #2609 from alalek:tests_fixes