fix some compile errors for min_by