             // There is only one so it's the default configuration
             if configurations.count == 1 {
                 
-                let storeURL = cachesURL.URLByAppendingPathComponent("\(namingPrefix)\(managedObjectModel.uniqueIdentifier())default.sqlite")
+                let storeURL = cachesURL.URLByAppendingPathComponent("\(prefix)\(managedObjectModel.uniqueIdentifier())default.sqlite")
                 
-                if let (storeType, storeOptions, migrationManager) = configurationOptions[defaultModelConfigurationName] {
+                if let (storeType, storeOptions, migrationManager) = options[defaultModelConfigurationName] {
                     try self.addPersistentStore(storeType, configuration: nil, URL: storeURL, options: storeOptions, migrationManger: migrationManager)
                 } else {
                     try self.addPersistentStore(NSSQLiteStoreType, configuration: nil, URL: storeURL, options: nil, migrationManger: nil)


public let configurationOptionsDefault: ConfigurationOptionsType = [defaultModelConfigurationName : (storeType: NSSQLiteStoreType, storeOptions: nil, migrationManager: nil)]

public class GenericCoreDataStack<OwnerType, CoordinatorType: NSPersistentStoreCoordinator, ContextType: NSManagedObjectContext> {
    
    private let managedObjectModel: NSManagedObjectModel
    private let persistentStoreCoordinator: CoordinatorType
    private let tag = String(OwnerType)
    
    // We allow access to the mainThreadContext
    private let mainContext: ContextType
    
    public init?(managedObjectModel model: NSManagedObjectModel, configurationOptions: ConfigurationOptionsType = configurationOptionsDefault, namingPrefix: String = "cache") {
        
        managedObjectModel = model;
        
        // Create the coordinator
        persistentStoreCoordinator = CoordinatorType(managedObjectModel: managedObjectModel)

                    
                    if configuration != defaultModelConfigurationName {
                        
                        let storeURL = cachesURL.URLByAppendingPathComponent("\(prefix)\(managedObjectModel.uniqueIdentifier())\(configuration).sqlite")
                        
                        if let (storeType, storeOptions, migrationManager) = options[configuration] {
                            try self.addPersistentStore(storeType, configuration: configuration, URL: storeURL, options: storeOptions, migrationManger: migrationManager)
                        } else {
                            try self.addPersistentStore(NSSQLiteStoreType, configuration: configuration, URL: storeURL, options: nil, migrationManger: nil)
