Fixed sorting bug in spreadsheet.