fix maxval (minus)