Fixed incorrect figures sorting