Fixed error raising in restrict_fields.