Fix broken tests and improve test running on Travis