Improved sorting for numeric values