Model fixes and initial sqls