GCP-6018 fix checking of minmax