Add test and fix error with diff calcul in model