Change all occurrences of plain sort() to std::sort()