Small bug fix in main model