Fix tests and add travis CI support