Fix test cases for travis-ci