Several minor fixes to Model