Improve tests to make TravisCI passing