Fixed bugs in spreadsheet flags.