Fix minval - it is used after all