Fixed c++ variant of quick median.