diff --git a/src/Cursor.cpp b/src/Cursor.cpp
index 6868651e21..01ec52631f 100644
--- a/src/Cursor.cpp
+++ b/src/Cursor.cpp
@@ -1496,13 +1496,13 @@ bool notifyCursorLeaves(DocIterator const & old, Cursor & cur)
 	// find inset in common
 	size_type i;
 	for (i = 0; i < old.depth() && i < cur.depth(); ++i) {
-		if (&old.inset() != &cur.inset())
+		if (&old[i].inset() != &cur[i].inset())
 			break;
 	}
 	
 	// notify everything on top of the common part in old cursor,
 	// but stop if the inset claims the cursor to be invalid now
-	for (;  i < old.depth(); ++i) {
+	for (; i < old.depth(); ++i) {
 		if (old[i].inset().notifyCursorLeaves(cur))
 			return true;
 	}
diff --git a/src/Cursor.h b/src/Cursor.h
index 7991d0890a..7c10fb090b 100644
--- a/src/Cursor.h
+++ b/src/Cursor.h
@@ -371,7 +371,7 @@ public:
 
 /**
  * Notifies all insets which appear in old, but not in cur. Make
- * Sure that the cursor old is valid, i.e. als inset pointer
+ * Sure that the cursor old is valid, i.e. all inset pointers
  * point to valid insets! Use Cursor::fixIfBroken if necessary.
  */
 bool notifyCursorLeaves(DocIterator const & old, Cursor & cur);
diff --git a/src/DocIterator.cpp b/src/DocIterator.cpp
index 54f54fa5f2..e4ea4be0b6 100644
--- a/src/DocIterator.cpp
+++ b/src/DocIterator.cpp
@@ -479,7 +479,7 @@ bool DocIterator::fixIfBroken()
 }
 
 
-DocIterator::idx_type DocIterator::find(MathData const & cell) const
+int DocIterator::find(MathData const & cell) const
 {
 	for (size_t l = 0; l != slices_.size(); ++l) {
 		if (slices_[l].asInsetMath() && &slices_[l].cell() == &cell)
@@ -489,7 +489,7 @@ DocIterator::idx_type DocIterator::find(MathData const & cell) const
 }
 
 
-DocIterator::idx_type DocIterator::find(InsetMath const * inset) const 
+int DocIterator::find(InsetMath const * inset) const 
 {
 	for (size_t l = 0; l != slices_.size(); ++l) {
 		if (slices_[l].asInsetMath() == inset)
@@ -499,14 +499,14 @@ DocIterator::idx_type DocIterator::find(InsetMath const * inset) const
 }
 
 
-void DocIterator::cutOff(DocIterator::idx_type above, vector<CursorSlice> & cut)
+void DocIterator::cutOff(int above, vector<CursorSlice> & cut)
 {
 	cut = vector<CursorSlice>(slices_.begin() + above + 1, slices_.end());
 	slices_.resize(above + 1);
 }
 
 
-void DocIterator::cutOff(DocIterator::idx_type above) 
+void DocIterator::cutOff(int above)
 {
 	slices_.resize(above + 1);
 }
diff --git a/src/DocIterator.h b/src/DocIterator.h
index 0c8eec3165..d994c3a1e7 100644
--- a/src/DocIterator.h
+++ b/src/DocIterator.h
@@ -212,13 +212,13 @@ public:
 	bool fixIfBroken();
 
 	/// find index of CursorSlice with &cell() == &cell (or -1 if not found)
-	idx_type find(MathData const & cell) const;
+	int find(MathData const & cell) const;
 	/// find index of CursorSlice with inset() == inset (or -1 of not found)
-	idx_type find(InsetMath const * inset) const;
-	/// cut off CursorSlices with index > above and store cut off slices in cut
-	void cutOff(idx_type above, std::vector<CursorSlice> & cut);
+	int find(InsetMath const * inset) const;
+	/// cut off CursorSlices with index > above and store cut off slices in cut.
+	void cutOff(int above, std::vector<CursorSlice> & cut);
 	/// cut off CursorSlices with index > above
-	void cutOff(idx_type above);
+	void cutOff(int above);
 	/// push CursorSlices on top
 	void append(std::vector<CursorSlice> const & x);
 	/// push one CursorSlice on top and set its index and position