Validation and defaults