Index: _source/plugins/wysiwygarea/plugin.js
===================================================================
--- _source/plugins/wysiwygarea/plugin.js	(revision 6044)
+++ _source/plugins/wysiwygarea/plugin.js	(revision )
@@ -47,7 +47,7 @@
 				var selIsLocked = selection.isLocked;
 
 				if ( selIsLocked )
-					selection.unlock();
+					selection.unlock( true );
 
 				var $sel = selection.getNative();
 
Index: _source/plugins/table/dialogs/table.js
===================================================================
--- _source/plugins/table/dialogs/table.js	(revision 5925)
+++ _source/plugins/table/dialogs/table.js	(revision )
@@ -247,7 +247,7 @@
 
 				// Insert the table element if we're creating one.
 				if ( !this._.selectedElement )
-					editor.insertElement( table );
+					editor.insertHtml( table.getOuterHtml() );
 				// Properly restore the selection inside table. (#4822)
 				else
 					selection.selectBookmarks( bms );
