Fixed negative error in models.R