diff -ruN caldavzap_0.9.0/data_process.js caldavzap/data_process.js
--- caldavzap_0.9.0/data_process.js	2013-06-27 23:41:02.000000000 +0200
+++ caldavzap/data_process.js	2013-07-01 14:49:57.718051001 +0200
@@ -4353,9 +4353,18 @@
 	// If vCalendar contains only '\n' instead of '\r\n' we correct this
 	if(vcalendarString.match(RegExp('\r', 'm'))==null)
 		vcalendarString=vcalendarString.replace(RegExp('\n', 'gm'), '\r\n');
+	
+	// remove multiple empty lines
+	vcalendarString=vcalendarString.replace(RegExp('(\r\n)+','gm'),'\r\n');
+	
 	// remove line folding
 	vcalendarString=vcalendarString.replace(RegExp('\r\n'+vCalendar.re['WSP'], 'gm'), '');
 	vcalendarString=vcalendarString.replaceAll('"','');
+	
+	// append '\r\n' to the end of the vCalendar if missing
+	if(vcalendarString[vcalendarString.length-1]!='\n')
+		vcalendarString+='\r\n';
+	
 	return vcalendarString;
 }
 
diff -ruN caldavzap_0.9.0/interface.js caldavzap/interface.js
--- caldavzap_0.9.0/interface.js	2013-06-27 23:41:02.000000000 +0200
+++ caldavzap/interface.js	2013-07-01 14:49:57.822051001 +0200
@@ -712,37 +712,6 @@
 var todoToggle=true;
 var transSpeedTodo=200;
 
-$(window).resize(function(evt){
-	if(evt.target!=window)
-		return;
-
-	if(typeof globalCalDAVInitLoad!='undefined' && !globalCalDAVInitLoad && typeof globalResourceRefresh!='undefined' && !globalResourceRefresh && $('#main').width()!=globalCalWidth) {
-		$('#ResizeLoader').show();
-	}
-
-	$('#SystemCalDAV .fc-header-title').css('width', $('#main_h_placeholder').width()-$('#SystemCalDAV .fc-header-left').width()-$('#SystemCalDAV .fc-header-right').width()-20);
-	$('#ResourceCalDAVList, #ResourceCalDAVTODOList').css('bottom',(typeof globalTimeZoneSupport!='undefined' && globalTimeZoneSupport ? 19 : 0));
-	$('#alertBox').css('left', ($(window).width()/2)-($('#alertBox').width()/2));
-	$('#calendar').fullCalendar('option', 'contentHeight', $('#main').height() - 14);
-	$('#todoList').fullCalendar('allowSelectEvent',false);
-	$('#todoList').fullCalendar('option', 'contentHeight', $('#mainTODO').height() - 14);
-	$('#todoList').fullCalendar('allowSelectEvent',true);
-	$('#todoList').fullCalendar('selectEvent', null, true);
-	if(globalCalDAVQs!=null)
-		globalCalDAVQs.cache();
-	if(globalCalDAVTODOQs!=null)
-		globalCalDAVTODOQs.cache();
-	if(globalDisplayHiddenEvents)
-		for(var k=1;k<globalResourceCalDAVList.collections.length;k++)
-			if(globalResourceCalDAVList.collections[k].uid!=undefined)
-			{
-				var pos=vR.indexOf(globalResourceCalDAVList.collections[k].uid);
-				if(pos!=-1)
-					$("#SystemCalDAV div [data-res-id='"+globalResourceCalDAVList.collections[k].uid+"']").addClass('checkCalDAV_hide');
-			}
-	globalCalWidth = $('#main').width();
-});
-
 $(document).ready(function() {
 	$('#ResourceCalDAVList, #ResourceCalDAVTODOList').css('bottom',(typeof globalTimeZoneSupport!='undefined' && globalTimeZoneSupport ? 19 : 0));
 	$('#alertBox').css('left', ($(window).width()/2)-($('#alertBox').width()/2));
@@ -897,7 +866,7 @@
 			$('.timezone_row').css('display', 'none');
 		}
 		else
-		{			
+		{
 			$('#time_from_cell').css('visibility','visible');
 			$('#time_to_cell').css('visibility','visible');
 			$('#time_from').change();
diff -ruN caldavzap_0.9.0/lib/fullcalendar.js caldavzap/lib/fullcalendar.js
--- caldavzap_0.9.0/lib/fullcalendar.js	2013-06-27 23:41:02.000000000 +0200
+++ caldavzap/lib/fullcalendar.js	2013-07-01 14:49:57.670051001 +0200
@@ -6775,7 +6775,7 @@
 			var eventEnd = event.end ? cloneDate(event.end) : cloneDate(event.start);
 
 			// skip events out of range
-			if ((event.completedOn && event.completedOn < t.start && (!event.start || event.completedOn > event.start)) ||
+			if ((event.completedOn && event.completedOn < t.start && (opt('showUnstartedEvents') || !event.start || event.completedOn > event.start)) ||
 				(!opt('showUnstartedEvents') && event.start && event.start > t.visEnd)) {
 				continue;
 			}
diff -ruN caldavzap_0.9.0/main.js caldavzap/main.js
--- caldavzap_0.9.0/main.js	2013-06-27 23:41:02.000000000 +0200
+++ caldavzap/main.js	2013-07-01 14:52:35.334051001 +0200
@@ -977,6 +977,37 @@
 
 function globalMainCalDAV()
 {
+	$(window).resize(function(evt){
+		if(evt.target!=window)
+			return;
+
+		if(typeof globalCalDAVInitLoad!='undefined' && !globalCalDAVInitLoad && typeof globalResourceRefresh!='undefined' && !globalResourceRefresh && $('#main').width()!=globalCalWidth) {
+			$('#ResizeLoader').show();
+		}
+
+		$('#SystemCalDAV .fc-header-title').css('width', $('#main_h_placeholder').width()-$('#SystemCalDAV .fc-header-left').width()-$('#SystemCalDAV .fc-header-right').width()-20);
+		$('#ResourceCalDAVList, #ResourceCalDAVTODOList').css('bottom',(typeof globalTimeZoneSupport!='undefined' && globalTimeZoneSupport ? 19 : 0));
+		$('#alertBox').css('left', ($(window).width()/2)-($('#alertBox').width()/2));
+		$('#calendar').fullCalendar('option', 'contentHeight', $('#main').height() - 14);
+		$('#todoList').fullCalendar('allowSelectEvent',false);
+		$('#todoList').fullCalendar('option', 'contentHeight', $('#mainTODO').height() - 14);
+		$('#todoList').fullCalendar('allowSelectEvent',true);
+		$('#todoList').fullCalendar('selectEvent', null, true);
+		if(globalCalDAVQs!=null)
+			globalCalDAVQs.cache();
+		if(globalCalDAVTODOQs!=null)
+			globalCalDAVTODOQs.cache();
+		if(globalDisplayHiddenEvents)
+			for(var k=1;k<globalResourceCalDAVList.collections.length;k++)
+				if(globalResourceCalDAVList.collections[k].uid!=undefined)
+				{
+					var pos=vR.indexOf(globalResourceCalDAVList.collections[k].uid);
+					if(pos!=-1)
+						$("#SystemCalDAV div [data-res-id='"+globalResourceCalDAVList.collections[k].uid+"']").addClass('checkCalDAV_hide');
+				}
+		globalCalWidth = $('#main').width();
+	});
+
 	/*************************** BAD HACKS SECTION ***************************/
 	if($.browser.msie || $.browser.mozilla)
 	{
diff -ruN caldavzap_0.9.0/resource.js caldavzap/resource.js
--- caldavzap_0.9.0/resource.js	2013-06-27 23:41:02.000000000 +0200
+++ caldavzap/resource.js	2013-07-01 14:49:57.730051001 +0200
@@ -243,10 +243,7 @@
 
 		if(inputResource.permissions.read_only)
 			newElement.addClass('resourceCalDAV_item_ro');
-		
-		if(inputResource.webdav_bind)
-			newElement.addClass('resourceCalDAV_item_ro');
-			
+
 		var checked='';
 		if(todoString=='')
 		{
@@ -266,7 +263,6 @@
 		newElement=newElement.parent().html();
 		$('#ResourceCalDAV'+todoString+'List').children().eq(insertIndex+headerMiss).after(newElement);
 
-		
 		var checkC=$('#ResourceCalDAV'+todoString+'List').find('[name^="'+inputResource.uid+'"]');
 		if(todoString=='TODO')
 		{
diff -ruN caldavzap_0.9.0/webdav_protocol.js caldavzap/webdav_protocol.js
--- caldavzap_0.9.0/webdav_protocol.js	2013-06-27 23:41:02.000000000 +0200
+++ caldavzap/webdav_protocol.js	2013-07-01 14:49:57.454051001 +0200
@@ -895,8 +895,7 @@
 
 							var read_only=false;
 							var href=$(element).children().filterNsNode('href').text();
-							
-							
+
 							if(permissions.length>0 && permissions.indexOf('all')==-1 && permissions.indexOf('write')==-1 && permissions.indexOf('write-content')==-1)
 								read_only=true;
 							else if(inputResource.forceReadOnly!=undefined && (inputResource.forceReadOnly==true || inputResource.forceReadOnly instanceof Array))
@@ -958,14 +957,11 @@
 							// insert the resource
 							var webdav_bind = false;
 							if(resources.children().filterNsNode('resourcetype').children().filterNsNode('webdav-binding').length==1)
-							{
 								webdav_bind=true;
-								read_only=true;
-							}
-							
+
 							var checkContentType=(inputResource.checkContentType==undefined ? true : inputResource.checkContentType);
-							
-							var syncRequired = true;
+
+							var syncRequired=true;
 							if(typeList.indexOf('vevent')!=-1)
 							{
 								globalResourceCalDAVList.insertResource({typeList:typeList, listType:'vevent', ecolor: color, timestamp: resultTimestamp, uid: uidBase+href, timeOut: inputResource.timeOut, displayvalue: displayvalue, userAuth: inputResource.userAuth, resourceIndex: indexR, url: baseHref, accountUID: origUID, href: href, hrefLabel: inputResource.hrefLabel, showHeader: inputResource.showHeader, permissions: {full: permissions, read_only: read_only}, crossDomain: inputResource.crossDomain, withCredentials: inputResource.withCredentials, interval: null, waitInterval: null, displayEventsArray: new Array(), pastUnloaded: '', fcSource: null, subscription: false, urlArray:null, ignoreAlarms:ignoreAlarms,webdav_bind:webdav_bind, syncRequired:syncRequired, checkContentType: checkContentType}, indexR, true);
@@ -2026,7 +2022,7 @@
 			if(response!='success')
 				return false;
 			
-			var vcalendarText = text.responseText;
+			var vcalendarText = vCalendarCleanup(text.responseText);
 			inputCollection.urlArray={};
 			
 			if(inputCollection.typeList.indexOf('vevent')!=-1)
