--- pathauto.inc	2008-08-26 16:55:19.000000000 +1200
+++ pathauto.inc	2008-12-19 22:35:02.000000000 +1300
@@ -243,13 +243,18 @@ function pathauto_cleanstring($string, $
     else {
       $seppattern = '\\'. $separator;
     }
-    // Trim any leading or trailing separators (note the need to
+    // Trim any leading or trailing separators
     $output = preg_replace("/^$seppattern+|$seppattern+$/", '', $output);
 
     // Replace multiple separators with a single one
     $output = preg_replace("/$seppattern+/", "$separator", $output);
   }
 
+  // Optionally convert to lower case
+  if (variable_get('pathauto_case', PATHAUTO_CASE_LOWER)) {
+    $output = drupal_strtolower($output);
+  }
+
   // Enforce the maximum component length
   $maxlength = min(variable_get('pathauto_max_component_length', 100), 128);
   $output = _pathauto_truncate_chars($output, $maxlength, $separator);
@@ -332,10 +337,6 @@ function pathauto_create_alias($module, 
   // and optionally lower-case the result
   $alias = str_replace($placeholders['tokens'], $placeholders['values'], $pattern);
 
-  if (variable_get('pathauto_case', PATHAUTO_CASE_LOWER)) {
-    $alias = drupal_strtolower($alias);
-  }
-
   // Two or more slashes should be collapsed into one
   $alias = preg_replace('/\/+/', '/', $alias);
 
