     ///
     /// - parameter block: A block that accesses the database.
     /// - throws: The error thrown by the block.
-    public func inDatabase<R>(block: (db: Database) throws -> R) rethrows -> R {
+    public func inDatabase<T>(block: (db: Database) throws -> T) rethrows -> T {
         return try inQueue {
             try block(db: self.database)
         }

    /// Synchronously executes a block in the database queue, wrapped inside a
    /// transaction.
    ///
    /// If the block throws an error, the transaction is rollbacked and the error is
    /// rethrown.
    ///
    ///     try dbQueue.inTransaction { db in
    ///         db.execute(...)

    
    // A function declared as rethrows that synchronously executes a throwing
    // block in a dispatch_queue.
    static func dispatchSync<T>(queue: dispatch_queue_t, block: () throws -> T) rethrows -> T {
        func dispatchSyncImpl(queue: dispatch_queue_t, block: () throws -> T, block2: (ErrorType) throws -> Void) rethrows -> T {
            var result: T? = nil
            var blockError: ErrorType? = nil
            dispatch_sync(queue) {
                do {
