Some fixes to model.