More slight fixes.
Add .validate_type() method to BaseModel.