Add tests and fix travis