     private static func maintenance() {
         Meow.log("Performing maintenance")
         
-        do {
-            Meow.pool.clean()
-            try Meow.pool.autoSave()
-        } catch {
-            Meow.log("❗ Error while performing maintenance")
-            Meow.log(error)
-            assertionFailure("\(error)")
-        }
+        Meow.pool.clean()
+        Meow.pool.maintenance()
         
         // Schedule next maintenance
         scheduleMaintenance()
     }
     
     private static func scheduleMaintenance() {
-        maintenanceQueue.asyncAfter(deadline: DispatchTime(secondsFromNow: maintenanceInterval), execute: Meow.maintenance)
+        maintenanceQueue.asyncAfter(deadline: DispatchTime(secondsFromNow: maintenanceInterval), flags: .barrier, execute: Meow.maintenance)
     }
     
     /// The ObjectPool is used to hold references to models to link them in-memory

            }
        }
        
        /// The amount of objects to keep strong references to
        public var strongReferenceAmount = 0
        
        private var strongReferences = [BaseModel]()
        
        /// The queue used to prevent crashes in mutations
        private let objectPoolMutationQueue = DispatchQueue(label: "org.openkitten.meow.objectPool", qos: .userInteractive)
        
        fileprivate init() {
            // Save the database contents before exiting

                    currentlyInstantiating[id] = instantiation
                    return instantiation
                }
            }()
            
            if instantiation.thread != Thread.current {
                Meow.log("Waiting for instance from other thread")
