Fix bugs tests uncovered and add travis CI.