Several fixes in the models