More fixes to median