Added some validation to the models.