Fixed a bug with required fields.