Updated sort_by_numbers to support underscores