diff --git a/sass.module b/sass.module
index 18bbf3c..d6c526c 100644
--- a/sass.module
+++ b/sass.module
@@ -25,12 +25,14 @@ function sass_preprocess_page(&$variables) {
 
   $SassParser_config = array(
     'style' => 'nested',  // nested (default), expanded, compact, compressed
-    'cache' => false,     // true (default) or false
+    'cache' => FALSE,     // true (default) or false
     'syntax' => 'scss',    // sass (default), scss, sassc
     'extensions' => array('compass'=>array()),
   );
 
-  if (!variable_get('sass_development_mode', true)) return;
+  if (!variable_get('sass_development_mode', TRUE)) {
+    return;
+  }
 
   # Bring in the theme info
   global $theme_info;
@@ -56,11 +58,18 @@ function sass_preprocess_page(&$variables) {
       $scss = str_replace('.css', '.'.$SassParser_config['syntax'], $stylesheet);
 
       // if we have Scss file and it modified after last compile
-      if (file_exists($scss) && filemtime($scss) > filemtime($stylesheet)) {
+      if (file_exists($scss) && (!file_exists($stylesheet) || (filemtime($scss) > filemtime($stylesheet)))) {
 
-        // check css file permissions and writeable
-        $stylesheet_permissions = file_perms($stylesheet);
-        $is_writable = is_writable($stylesheet);
+        // check css file permissions and writeable - if the file doesn't exist
+        // yet, we use the directory it's in
+        if (file_exists($stylesheet)) {
+          $stylesheet_permissions = sass_file_perms($stylesheet);
+          $is_writable = is_writable($stylesheet);
+        }
+        else {
+          $stylesheet_permissions = sass_file_perms(dirname($stylesheet));
+          $is_writable = is_writable(dirname($stylesheet));
+        }
 
         if ($is_writable) {
 
@@ -68,22 +77,23 @@ function sass_preprocess_page(&$variables) {
           $converted_css = $sass_parser->toCss($scss);
 
           file_put_contents($stylesheet, $converted_css);
-          //        chmod($stylesheet, 0644);
-          if (variable_get('sass_show_development_mode_warning', true)) {
-            drupal_set_message(t('Your SASS / SCSS stylesheets are currently being rebuilt on every request. Ensure you disable <a href="!link">development mode</a> for production sites.', array('!link' => url('admin/config/development/sass'))), 'warning');
+          if (variable_get('sass_show_development_mode_warning', TRUE)) {
+            drupal_set_message(t('Your SASS / SCSS stylesheets are currently being rebuilt on every request. Ensure you disable <a href="@link">development mode</a> for production sites.', array('@link' => url('admin/config/development/sass'))), 'warning');
           }
         }
         else {
-          drupal_set_message(t('Your SASS / SCSS stylesheets are currently can\'t being rebuilt through the permissions on the stylesheet file "!file". Please grant more rights. Current permissions is !perms', array('!file' => $stylesheet, '!perms' => $stylesheet_permissions)), 'error');
+          drupal_set_message(t('Your SASS / SCSS stylesheets are currently not being rebuilt due to the permissions on the stylesheet file "@file". Please grant more rights. Current permissions are @perms', array('@file' => $stylesheet, '@perms' => $stylesheet_permissions)), 'error');
         }
       }
     }
   }
 }
 
-function file_perms($file, $octal = false) {
-  if (!file_exists($file)) return false;
-  $perms = fileperms($file);
-  $cut = $octal ? 2 : 3;
-  return substr(decoct($perms), $cut);
+function sass_file_perms($file) {
+  if (!file_exists($file)) {
+    return '000';
+  }
+  else {
+    return substr(decoct(fileperms($file)), 2);
+  }
 }
