diff --git a/inc/HTTP/WebDAV/Server/Filesystem.php b/inc/HTTP/WebDAV/Server/Filesystem.php
index b99bbdbb81eece50170a73193711b30f34031b97..a41d36873036ad1ca7762827cc7e6d52191b40e5 100755
--- a/inc/HTTP/WebDAV/Server/Filesystem.php
+++ b/inc/HTTP/WebDAV/Server/Filesystem.php
@@ -324,6 +324,7 @@
      */
     function PUT(&$options) 
     {
+		error_log("put $fspath");
         $fspath = $options["path"];
         $dir = dirname($fspath);
         if (!OC_FILESYSTEM::file_exists($dir) || !OC_FILESYSTEM::is_dir($dir)) {
@@ -641,14 +642,14 @@
                 return true;
             } else {//check for indirect refresh
                $query = "SELECT *
-                  FROM locks
+                  FROM {$CONFIG_DBTABLEPREFIX}locks
                  WHERE recursive = 1
                ";
             $res = OC_DB::select($query);
             foreach($res as $row){
 				if(strpos($options['path'],$row['path'])==0){//are we a child of a folder with an recursive lock
 					$where = "WHERE path = '$row[path]' AND token = '$options[update]'";
-					 $query = "UPDATE `locks` SET `expires` = '$options[timeout]', `modified` = ".time()." $where";
+					 $query = "UPDATE `{$CONFIG_DBTABLEPREFIX}locks` SET `expires` = '$options[timeout]', `modified` = ".time()." $where";
                 OC_DB::query($query);
                 $options['owner'] = $row['owner'];
                 $options['scope'] = $row["exclusivelock"] ? "exclusive" : "shared";
@@ -727,7 +728,7 @@
         }else{
 			//check for recursive locks;
 			$query = "SELECT *
-                  FROM locks
+                  FROM {$CONFIG_DBTABLEPREFIX}locks
                  WHERE recursive = 1
                ";
             $res = OC_DB::select($query);
diff --git a/inc/lib_config.php b/inc/lib_config.php
index 78e10f9474e474891b4a997116867d76f9f46878..dad2fbf81599972f917987b13e53aebfd5249bd9 100755
--- a/inc/lib_config.php
+++ b/inc/lib_config.php
@@ -336,7 +336,6 @@ class OC_CONFIG{
 				$result = pg_exec($connection, $query);
 			}
 		}
-		global $CONFIG_DBTABLEPREFIX;
 	}
 }
 ?>
diff --git a/inc/lib_log.php b/inc/lib_log.php
index f163fb9fe949adc2462c5284f9777cdd26ba52e3..ce46e9a683d90225d83e6ff36e17c119b22a4b72 100755
--- a/inc/lib_log.php
+++ b/inc/lib_log.php
@@ -69,7 +69,6 @@ class OC_LOG {
 		$user=$_SESSION['username_clean'];
 		$result = OC_DB::select('select `timestamp`,`user`,`type`,`message` from '.$CONFIG_DBTABLEPREFIX.'log where user=\''.$user.'\' order by timestamp desc limit 20');
 	}
-	$result = OC_DB::select($query);
     foreach($result as $entry){
       echo('<tr class="browserline">');
       echo('<td class="sizetext">'.date($CONFIG_DATEFORMAT,$entry['timestamp']).'</td>');