Index: _source/plugins/removeformat/plugin.js
===================================================================
--- _source/plugins/removeformat/plugin.js	(revision 6247)
+++ _source/plugins/removeformat/plugin.js	(working copy)
@@ -41,18 +41,16 @@
 
 				while ( ( range = iterator.getNextRange() ) )
 				{
-					if ( range.collapsed )
-						continue;
+					if ( ! range.collapsed )
+						range.enlarge( CKEDITOR.ENLARGE_ELEMENT );
 
-					range.enlarge( CKEDITOR.ENLARGE_ELEMENT );
-
 					// Bookmark the range so we can re-select it after processing.
-					var bookmark = range.createBookmark();
+					var bookmark = range.createBookmark(),
+						// The style will be applied within the bookmark boundaries.
+						startNode	= bookmark.startNode,
+						endNode		= bookmark.endNode,
+						currentNode;
 
-					// The style will be applied within the bookmark boundaries.
-					var startNode	= bookmark.startNode,
-						endNode		= bookmark.endNode;
-
 					// We need to check the selection boundaries (bookmark spans) to break
 					// the code in a way that we can properly remove partially selected nodes.
 					// For example, removing a <b> style from
@@ -81,37 +79,40 @@
 					};
 
 					breakParent( startNode );
-					breakParent( endNode );
+					if ( endNode )
+					{
+						breakParent( endNode );
 
-					// Navigate through all nodes between the bookmarks.
-					var currentNode = startNode.getNextSourceNode( true, CKEDITOR.NODE_ELEMENT );
+						// Navigate through all nodes between the bookmarks.
+						currentNode = startNode.getNextSourceNode( true, CKEDITOR.NODE_ELEMENT );
 
-					while ( currentNode )
-					{
-						// If we have reached the end of the selection, stop looping.
-						if ( currentNode.equals( endNode ) )
-							break;
+						while ( currentNode )
+						{
+							// If we have reached the end of the selection, stop looping.
+							if ( currentNode.equals( endNode ) )
+								break;
 
-						// Cache the next node to be processed. Do it now, because
-						// currentNode may be removed.
-						var nextNode = currentNode.getNextSourceNode( false, CKEDITOR.NODE_ELEMENT );
+							// Cache the next node to be processed. Do it now, because
+							// currentNode may be removed.
+							var nextNode = currentNode.getNextSourceNode( false, CKEDITOR.NODE_ELEMENT );
 
-						// This node must not be a fake element.
-						if ( !( currentNode.getName() == 'img'
-							&& currentNode.data( 'cke-realelement' ) )
-							&& filter( editor, currentNode ) )
-						{
-							// Remove elements nodes that match with this style rules.
-							if ( tagsRegex.test( currentNode.getName() ) )
-								currentNode.remove( 1 );
-							else
+							// This node must not be a fake element.
+							if ( !( currentNode.getName() == 'img'
+								&& currentNode.data( 'cke-realelement' ) )
+								&& filter( editor, currentNode ) )
 							{
-								currentNode.removeAttributes( removeAttributes );
-								editor.fire( 'removeFormatCleanup', currentNode );
+								// Remove elements nodes that match with this style rules.
+								if ( tagsRegex.test( currentNode.getName() ) )
+									currentNode.remove( 1 );
+								else
+								{
+									currentNode.removeAttributes( removeAttributes );
+									editor.fire( 'removeFormatCleanup', currentNode );
+								}
 							}
+
+							currentNode = nextNode;
 						}
-
-						currentNode = nextNode;
 					}
 
 					range.moveToBookmark( bookmark );
