various fixes to the model