C++: Fix currentLabels sorting