             let db: Sqlite3
             var values = [[Any]]()
             for book in books {
-                values.append([book.bookId, book.ordinal, book.name, book.lastChapter])
+                values.append([book.bookId, (book.ordinal + 1), book.name, book.lastChapter])
             }
             do {
                 db = try self.getBibleDB(bibleId: bibleId)
-                let sql = "REPLACE INTO TableContents (code, chapterRowId, name, lastChapter)"
+                let sql = "REPLACE INTO TableContents (code, rowid, name, lastChapter)"
                     + " VALUES (?,?,?,?)"
                 _ = try db.bulkExecuteV1(sql: sql, values: values)
             } catch let err {

            let create1 = "CREATE TABLE IF NOT EXISTS TableContents("
                + " code TEXT PRIMARY KEY NOT NULL,"
                + " name TEXT NOT NULL,"
                + " lastChapter INT NOT NULL,"
                + " chapterRowId INT NOT NULL)"
            _ = try db?.executeV1(sql: create1, values: [])
            let create2 = "CREATE TABLE IF NOT EXISTS Chapters("
                + " reference TEXT NOT NULL PRIMARY KEY,"

    
    func getTableContents(bibleId: String) -> [Book] {
        let db: Sqlite3
        var toc = [Book]()
        do {
            db = try self.getBibleDB(bibleId: bibleId)
            let sql = "SELECT code, name, lastChapter FROM TableContents ORDER BY rowid"
            let resultSet = try db.queryV1(sql: sql, values: [])
            for index in 0..<resultSet.count {
                let row = resultSet[index]
                toc.append(Book(bookId: row[0]!, ordinal: index, name: row[1]!,
                                lastChapter: Int(row[2]!) ?? 0))
            }
            return toc
        } catch let err {
