Fixed check of required fields.