Fix test cases for Travis CI