Bug fixes in models.