Validating input.