Index: trunk/bin/module_maker/skel/admin.php
===================================================================
--- trunk/bin/module_maker/skel/admin.php	(revision 557)
+++ trunk/bin/module_maker/skel/admin.php	(revision 558)
@@ -233,5 +233,5 @@
 function &editRecordForm($id)
 {
-    global $lock;
+    global $lock, $locally_carried_queries;
     $db =& DB::getInstance();
     $app =& App::getInstance();
@@ -274,6 +274,5 @@
 function deleteRecord($id)
 {
-    global $lock;
-    global $cache;
+    global $lock, $cache, $locally_carried_queries;
     $db =& DB::getInstance();
     $app =& App::getInstance();
Index: trunk/lib/App.inc.php
===================================================================
--- trunk/lib/App.inc.php	(revision 557)
+++ trunk/lib/App.inc.php	(revision 558)
@@ -1486,6 +1486,6 @@
         }
 
-        if (!isset($_SESSION['_app'][$this->_ns]['boomerang'])) {
-            $this->logMsg(sprintf('validBoomerangURL(%s) no boomerang URL set.', $id), LOG_DEBUG, __FILE__, __LINE__);
+        if (!isset($_SESSION['_app'][$this->_ns]['boomerang']) || !is_array($_SESSION['_app'][$this->_ns]['boomerang']) || empty($_SESSION['_app'][$this->_ns]['boomerang'])) {
+            $this->logMsg(sprintf('validBoomerangURL(%s) no boomerang URL set, not an array, or empty.', $id), LOG_DEBUG, __FILE__, __LINE__);
             return false;
         }
@@ -1496,5 +1496,5 @@
             $added_time = $_SESSION['_app'][$this->_ns]['boomerang'][$id]['added_time'];
         } else if (!isset($id) || $use_nonspecificboomerang) {
-            // Use non specific boomerang if available.
+            // Use most recent, non-specific boomerang if available.
             $url = end($_SESSION['_app'][$this->_ns]['boomerang'])['url'];
             $added_time = end($_SESSION['_app'][$this->_ns]['boomerang'])['added_time'];
Index: trunk/lib/Cache.inc.php
===================================================================
--- trunk/lib/Cache.inc.php	(revision 557)
+++ trunk/lib/Cache.inc.php	(revision 558)
@@ -189,4 +189,6 @@
         $_SESSION['_cache'][$this->_ns][$key] =& $var;
 
+        $app->logMsg(sprintf('Set cache item â%sâ', $key), LOG_DEBUG, __FILE__, __LINE__);
+
         if ($var_len >= 1024000) {
             $app->logMsg(sprintf('Successfully cached oversized variable (%s bytes).', $var_len), LOG_DEBUG, __FILE__, __LINE__);
@@ -262,4 +264,5 @@
 
         if (isset($_SESSION['_cache'][$this->_ns]) && array_key_exists($key, $_SESSION['_cache'][$this->_ns])) {
+            $app->logMsg(sprintf('Deleting cache item â%sâ', $key), LOG_DEBUG, __FILE__, __LINE__);
             unset($_SESSION['_cache'][$this->_ns][$key]);
             return true;
Index: trunk/lib/Upload.inc.php
===================================================================
--- trunk/lib/Upload.inc.php	(revision 557)
+++ trunk/lib/Upload.inc.php	(revision 558)
@@ -276,5 +276,5 @@
             // Check to be sure the file has a valid file name extension.
             if (!in_array(mb_strtolower(self::getFilenameExtension($file_name)), $this->getParam('valid_file_extensions'))) {
-                // TODO: Add option to allow any extention to be uploaded.
+                // TODO: Add option to allow any extension to be uploaded.
                 $this->_raiseMsg(sprintf(_("The file %s failed uploading: it is an unrecognized type. Files must have one of the following file name extensions: %s."), $file_name, join(', ', $this->getParam('valid_file_extensions'))), MSG_ERR, __FILE__, __LINE__);
                 $app->logMsg(sprintf('The uploaded file %s has an unrecognized file name extension.', $file_name), LOG_WARNING, __FILE__, __LINE__);
@@ -293,5 +293,5 @@
             // If the file name has no extension, use the mime-type to choose one.
             if (!preg_match('/\.[^.]{1,5}$/', $file_name) && function_exists('mime_content_type')) {
-                // TODO: will this run if an extention is filtered by 'valid_file_extensions'?
+                // TODO: will this run if an extension is filtered by 'valid_file_extensions'?
                 if ($ext = array_search(mime_content_type($files['tmp_name'][$i]), $this->mime_extension_map)) {
                     $file_name .= ".$ext";
