a lot more bug fixes to models