 
     public func modelForRoot() -> Deferred<Maybe<BookmarksModel>> {
         // Return a virtual model containing "Desktop bookmarks" prepended to the local mobile bookmarks.
-
-        guard let mobile = self.local.folderForGUID(BookmarkRoots.MobileFolderGUID, title: BookmarksFolderTitleMobile) else {
-            return deferMaybe(DatabaseError(description: "Unable to fetch mobile bookmarks."))
-        }
-
-        return self.mirror.extendWithDesktopBookmarksFolder(mobile, factory: self)
+        return self.local.folderForGUID(BookmarkRoots.MobileFolderGUID, title: BookmarksFolderTitleMobile)
+            >>== { folder in
+                return self.mirror.extendWithDesktopBookmarksFolder(folder, factory: self)
+        }
     }
 
     // Whenever async construction is necessary, we fall into a pattern of needing


            for args in values {
                if let error = conn.executeChange(update, withArgs: args) {
                    log.error("Updating mirror: \(error.description).")
                    err = error
                    deferred.fill(Maybe(failure: DatabaseError(err: error)))
                    return false

        self.favicons = FaviconsTable<Favicon>()
    }

    /**
     * Return the children of the provided parent.
     * Rows are ordered by positional index.
     * This method is aware of is_overridden and deletion, using local override structure by preference.
     * Note that a folder can be empty locally; we thus use the flag rather than looking at the structure itself.
     */
    private func getChildrenWithParent(parentGUID: GUID, excludingGUIDs: [GUID]?=nil, includeIcon: Bool) -> Deferred<Maybe<Cursor<BookmarkNode>>> {
        let childrenOfLocallyOverridden =
        "SELECT parent, child AS guid, idx FROM \(TableBookmarksLocalStructure) WHERE parent = ?"

        // This could be a view: a join between structure and mirror.
        let childrenOfNotOverridden =
        "SELECT parent, child AS guid, idx FROM \(TableBookmarksMirrorStructure) " +
        "WHERE " +
        "((SELECT is_overridden FROM \(TableBookmarksMirror) WHERE guid = ?) IS NOT 1) " +
        "AND parent = ?"

        // This could be a view.
        let either =
        childrenOfLocallyOverridden + " UNION ALL " + childrenOfNotOverridden + " ORDER BY idx ASC"

        // This could be a view.
        let values =
        "SELECT -1 AS id, guid, type, is_deleted, parentid, parentName, feedUri, pos, title, bmkUri, folderName, faviconID " +
        "FROM \(TableBookmarksMirror) WHERE is_overridden IS NOT 1 " +
        "UNION ALL " +
        "SELECT -1 AS id, guid, type, is_deleted, parentid, parentName, feedUri, pos, title, bmkUri, folderName, faviconID " +
        "FROM \(TableBookmarksLocal) WHERE is_deleted IS NOT 1"


        let args: Args
        let exclusion: String
        if let excludingGUIDs = excludingGUIDs {
            args = ([parentGUID, parentGUID, parentGUID] + excludingGUIDs).map { $0 as AnyObject }
            exclusion = "WHERE vals.guid NOT IN " + BrowserDB.varlist(excludingGUIDs.count)
        } else {
            args = [parentGUID, parentGUID, parentGUID]
            exclusion = ""
        }

        let fleshed =
        "SELECT vals.id AS id, vals.guid AS guid, vals.type AS type, vals.is_deleted AS is_deleted, " +
        "       vals.parentid AS parentid, vals.parentName AS parentName, vals.feedUri AS feedUri, " +
        "       vals.pos AS pos, vals.title AS title, vals.bmkUri AS bmkUri, vals.folderName AS folderName, " +
        "       vals.faviconID AS faviconID, " +
        "       structure.idx AS idx, " +
        "       structure.parent AS _parent " +
        "FROM (\(either)) AS structure JOIN (\(values)) AS vals " +
        "ON vals.guid = structure.guid " +
        exclusion

        let withIcon =
        "SELECT bookmarks.id AS id, bookmarks.guid AS guid, bookmarks.type AS type, " +
        "       bookmarks.is_deleted AS is_deleted, " +
        "       bookmarks.parentid AS parentid, bookmarks.parentName AS parentName, " +
        "       bookmarks.feedUri AS feedUri, bookmarks.pos AS pos, title AS title, " +
        "       bookmarks.bmkUri AS bmkUri, bookmarks.folderName AS folderName, " +
        "       bookmarks.idx AS idx, bookmarks._parent AS _parent, " +
        "       favicons.url AS iconURL, favicons.date AS iconDate, favicons.type AS iconType " +
        "FROM (\(fleshed)) AS bookmarks " +
        "LEFT OUTER JOIN favicons ON bookmarks.faviconID = favicons.id"

        let sql = (includeIcon ? withIcon : fleshed) + " ORDER BY idx ASC"
        return self.db.runQuery(sql, args: args, factory: BookmarkFactory.factory)
    }

    private func getRootChildren() -> Deferred<Maybe<Cursor<BookmarkNode>>> {
        return self.getChildrenWithParent(BookmarkRoots.RootGUID, excludingGUIDs: [BookmarkRoots.RootGUID], includeIcon: true)
    }

    private func getChildren(guid: String) -> Deferred<Maybe<Cursor<BookmarkNode>>> {
        return self.getChildrenWithParent(guid, includeIcon: true)
    }

    func folderForGUID(guid: GUID, title: String) -> Deferred<Maybe<BookmarkFolder>> {
        return self.getChildren(guid)
            >>== { cursor in

            if cursor.status == .Failure {
                return deferMaybe(DatabaseError(description: "Couldn't get children: \(cursor.statusMessage)."))
            }

            let folder = SQLiteBookmarkFolder(guid: guid, title: title, children: cursor)

            // We add some suggested sites to the mobile bookmarks folder only.
            if guid == BookmarkRoots.MobileFolderGUID {
                return deferMaybe(BookmarkFolderWithDefaults(folder: folder, sites: SuggestedSites))
            }

            return deferMaybe(folder)
        }
    }

    private func modelWithRoot(root: BookmarkFolder) -> Deferred<Maybe<BookmarksModel>> {
        return deferMaybe(BookmarksModel(modelFactory: self, root: root))
    }

    public func modelForFolder(guid: String, title: String) -> Deferred<Maybe<BookmarksModel>> {
        let outputTitle = titleForSpecialGUID(guid) ?? title
        return self.folderForGUID(guid, title: outputTitle)
          >>== self.modelWithRoot
    }

    public func modelForFolder(folder: BookmarkFolder) -> Deferred<Maybe<BookmarksModel>> {
