Better validation for type.