Make MinMaxElementsValidation type-safe