     }
     
     override func shouldUpdateFocusInContext(context: UIFocusUpdateContext) -> Bool {
+        print("shouldUpdateFocusInContext: " + debugFocusChange(context))
+        
         let (_, to) = self.convertToIndexPaths(context)
         guard to != nil else {
             return false
         }
 
+        if jumpFromIndex != nil {
+            if focusHeading != context.focusHeading {
+                // Swapped directions mid jump -- abort
+                jumpFromIndex = nil
+                jumpToIndex = nil
+                jumpToFocusIndex = nil
+            }
+        }
+        
         focusHeading = context.focusHeading
-        if focusHeading == .Left && to!.item < buffer {
-            print("Going left, asking to go to \(to!.item); sending to \(buffer + count - 1); focusing on \(to!.item + count)")
-            jumpFromIndex = jumpFromIndex ?? to!.item
-            jumpToIndex = buffer + count - 1
-            jumpToFocusIndex = to!.item + count
-        }
-        
-        if focusHeading == .Right && to!.item >= buffer + count {
-            print("Going right, asking to go to \(to!.item); sending to \(buffer); focusing on \(to!.item - count)")
-            jumpFromIndex = jumpFromIndex ?? to!.item
-            jumpToIndex = buffer
-            jumpToFocusIndex = to!.item - count
+        if focusHeading == .Left {
+            if to!.item < 0 {
+                return false
+            }
+            if to!.item < buffer {
+                print("Going left, asking to go to \(to!.item); sending to \(buffer + count - 1); focusing on \(to!.item + count)")
+                jumpFromIndex = jumpFromIndex ?? to!.item
+                jumpToIndex = buffer + count - 1
+                jumpToFocusIndex = to!.item + count
+            }
+        }
+        
+        if focusHeading == .Right {
+            if to!.item >= 2*buffer + count {
+                return false
+            }
+            if to!.item >= buffer + count {
+                print("Going right, asking to go to \(to!.item); sending to \(buffer); focusing on \(to!.item - count)")
+                jumpFromIndex = jumpFromIndex ?? to!.item
+                jumpToIndex = buffer
+                jumpToFocusIndex = to!.item - count
+            }
         }
 
         return true
+    }
+    
+    override func didUpdateFocusInContext(context: UIFocusUpdateContext, withAnimationCoordinator coordinator: UIFocusAnimationCoordinator) {
+        print("didUpdateFocus: " + debugFocusChange(context))
+        
+        super.didUpdateFocusInContext(context, withAnimationCoordinator: coordinator)
     }
 
     

    
    var lastOffset: CGFloat = 0
    func scrollViewDidScroll(scrollView: UIScrollView) {
        
        guard let jumpIndex = jumpFromIndex else {
            return
        }

        return (from: from, to: to)
    }
    
    func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        count = rootDataSource.collectionView(collectionView, numberOfItemsInSection: section)
        return count + 2 * buffer
