         innerArray.replaceRange(subRange, with: newElements)
 
         batchUpdate(self) {
-            self.onDidRemoveRange.fire(removed, subRange)
-            self.onDidInsertRange.fire(inserted, newRange)
+            if !removed.isEmpty {
+                self.onDidRemoveRange.fire(removed, subRange)
+            }
+            if !inserted.isEmpty {
+                self.onDidInsertRange.fire(inserted, newRange)
+            }
         }
     }
     

    
    public func removeRange(subRange: Range<Int>) {
        let removed = Array(innerArray[subRange])
        innerArray.removeRange(subRange)
        onDidRemoveRange.fire(removed, subRange)
    }
    
    public func removeAll(keepCapacity: Bool) {
        let start = 0
        let end = innerArray.count
        

    
    public func extend<S: SequenceType where S.Generator.Element == T>(newElements: S) {
        let values = [T](newElements)
        
        if values.isEmpty {
            return
        }
        
        let start = innerArray.count
        let end = start + values.count
        
