Various fixes to models