Add tests and fix the lasts failures