Added validation for fields.