                 
             case .InMemory:
                 var error: NSError? = nil
-                persistentStoreCoordinator.addPersistentStoreWithType(NSInMemoryStoreType, configuration: self.rootSavingDataContextOptions.configuration, URL: nil, options: self.rootSavingDataContextOptions.options as [NSObject : AnyObject], error: &error)
+                persistentStoreCoordinator.addPersistentStoreWithType(NSInMemoryStoreType, configuration: self.contextOptions.configuration, URL: nil, options: self.contextOptions.options as [NSObject : AnyObject], error: &error)
                 
                 if error != nil {
                     return

public func performInBackground<T: Context>(parentContext: T, usingNewBackgroundManagedObjectContext: Bool, closure: (T) -> Void) {
    let backgroundContext = createBackgroundContext(parentContext, usingNewBackgroundManagedObjectContext)
    
    backgroundContext.perform {
        closure(backgroundContext)
    }
}

        // only the root data context has a direct assigned persistent store coordinator
        self.assignPersistentStoreCoordinator()
    }

    public required init(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    private func assignPersistentStoreCoordinator() {
        // managed object model
        if let managedObjectModelURL = self.contextOptions.managedObjectModelURL, let managedObjectModel = NSManagedObjectModel(contentsOfURL: managedObjectModelURL) {
            // persistent store coordinator
            let persistentStoreCoordinator = NSPersistentStoreCoordinator(managedObjectModel: managedObjectModel)
            
            // persistent store
            switch self.contextOptions.storeType {
            case .SQLite:
                if let persistentStoreURL = self.contextOptions.persistentStoreURL,
                    let containerURL = persistentStoreURL.URLByDeletingLastPathComponent {
                        // if the directory does not exist, it will be created
                        var fileManagerError: NSError? = nil
                        if NSFileManager.defaultManager().createDirectoryAtURL(containerURL, withIntermediateDirectories: true, attributes: nil, error: &fileManagerError) {
                            var error: NSError? = nil
                            persistentStoreCoordinator.addPersistentStoreWithType(NSSQLiteStoreType, configuration: self.contextOptions.configuration, URL: persistentStoreURL, options: self.contextOptions.options as [NSObject : AnyObject], error: &error)
                            
                            if let error = error {
                                var handled = false
