Another median algorithm fix