Many bug fixes
Fixed spreadsheet output