Correct a possible underflow that may crash LS2.
Use the proper median of the list.