Fix unit test issues on travis and add badge