diff --git a/apps/calendar/lib/calendar.php b/apps/calendar/lib/calendar.php
index 277539af97d7cbbeb1010b21a3c921a0759ad2f0..7eeb004d181c3e47bcfd4fa1b276756cb4df9119 100644
--- a/apps/calendar/lib/calendar.php
+++ b/apps/calendar/lib/calendar.php
@@ -240,9 +240,10 @@ class OC_Calendar_Calendar{
 			'#9fc6e7', // "light blue"
 		);
 	}
+
 	public static function getEventSourceInfo($calendar){
 		return array(
-			'url' => 'ajax/events.php?calendar_id='.$calendar['id'],
+			'url' => OC_Helper::linkTo('calendar', 'ajax/events.php').'?calendar_id='.$calendar['id'],
 			'backgroundColor' => $calendar['calendarcolor'],
 			'borderColor' => '#888',
 			'textColor' => 'black',
diff --git a/apps/contacts/lib/app.php b/apps/contacts/lib/app.php
index ff348403a9bf7838bcbb868ab98df901178e959b..ce52df4b75ef89f224fcc85ffc9b87d54e19690e 100644
--- a/apps/contacts/lib/app.php
+++ b/apps/contacts/lib/app.php
@@ -83,7 +83,7 @@ class OC_Contacts_App {
 		$vcard = OC_VObject::parse($card['carddata']);
 		// Try to fix cards with missing 'N' field from pre ownCloud 4. Hot damn, this is ugly...
 		if(!is_null($vcard) && !$vcard->__isset('N')) {
-			$appinfo = $info=OC_App::getAppInfo('contacts');
+			$appinfo = OC_App::getAppInfo('contacts');
 			if($appinfo['version'] >= 5) {
 				OC_Log::write('contacts','OC_Contacts_App::getContactVCard. Deprecated check for missing N field', OC_Log::DEBUG);
 			}
diff --git a/apps/contacts/lib/hooks.php b/apps/contacts/lib/hooks.php
index 10ae82bbf4f0bf3df2d8d713c399bdf808975dae..b858c4a5a48a91e6bb0444257ccef65e8f6e5d04 100644
--- a/apps/contacts/lib/hooks.php
+++ b/apps/contacts/lib/hooks.php
@@ -29,7 +29,7 @@ class OC_Contacts_Hooks{
 	 * @param paramters parameters from postDeleteUser-Hook
 	 * @return array
 	 */
-	public function deleteUser($parameters) {
+	static public function deleteUser($parameters) {
 		$addressbooks = OC_Contacts_Addressbook::all($parameters['uid']);
 
 		foreach($addressbooks as $addressbook) {
diff --git a/lib/base.php b/lib/base.php
index 5a4904c50f2b7b6b89c4ebae4125640ef680e7cf..0df6631df4db0672c5145670da5fd97c3c29b4f1 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -213,7 +213,15 @@ class OC{
 		}
 
 		// set the right include path
-		set_include_path(OC::$SERVERROOT.'/lib'.PATH_SEPARATOR.OC::$SERVERROOT.'/config'.PATH_SEPARATOR.OC::$THIRDPARTYROOT.'/3rdparty'.PATH_SEPARATOR.OC::$APPSROOT.PATH_SEPARATOR.OC::$APPSROOT.'/apps'.PATH_SEPARATOR.get_include_path().PATH_SEPARATOR.OC::$SERVERROOT);
+		set_include_path(
+			OC::$SERVERROOT.'/lib'.PATH_SEPARATOR.
+			OC::$SERVERROOT.'/config'.PATH_SEPARATOR.
+			OC::$THIRDPARTYROOT.'/3rdparty'.PATH_SEPARATOR.
+			OC::$APPSROOT.PATH_SEPARATOR.
+			OC::$APPSROOT.'/apps'.PATH_SEPARATOR.
+			get_include_path().PATH_SEPARATOR.
+			OC::$SERVERROOT
+		);
 
 		// Redirect to installer if not installed
 		if (!OC_Config::getValue('installed', false) && OC::$SUBURI != '/index.php') {