diff --git a/skinr.module b/skinr.module
index 85cc4f3f73191667462e20bcb00560cd76e40725..eef2dd00e7b6fdb7a0b20dc7026f9a9aa7030051 100644
--- a/skinr.module
+++ b/skinr.module
@@ -921,7 +921,8 @@ function skinr_skin_info_status_set($skin_info, $status) {
  * Helper function to prepend a path to an array of stylesheet or script filenames.
  *
  * If the url is absolute (e.g. the url start with 'http://' or 'https://')
- * the path does not get prepended.
+ * or relative to the site's root (e.g. the url starts with '/') the path does
+ * not get prepended.
  *
  * @param $files
  *   A an array of filenames that need the path prepended.
@@ -930,20 +931,45 @@ function skinr_skin_info_status_set($skin_info, $status) {
  *   The path to prepend.
  */
 function _skinr_add_path_to_files(&$files, $path) {
-  foreach ($files as $key => $file) {
-    if (is_array($file)) {
-      if (strpos($file[0], 'http://') === 0 || strpos($file[0], 'https://') === 0 ) {
-        continue;
+  $newfiles = array();
+  foreach ($files as $data => $options) {
+    if (!is_array($options)) {
+      // $options is not an array, it's a filename and passed as first
+      // (and only) argument.
+      if (_skinr_is_local_file($path . '/' . $options)) {
+        $options = $path . '/' . $options;
       }
-      $files[$key][0] = $path . '/' . $file[0];
+      $newfiles[] = $options;
+    }
+    elseif (is_numeric($data)) {
+      // If $options is an array, but $data is not a filename, find $data in the
+      // $options array.
+      if (_skinr_is_local_file($path . '/' . $options['data'])) {
+        $options['data'] = $path . '/' . $options['data'];
+      }
+      $newfiles[] = $options;
     }
     else {
-      if (strpos($file, 'http://') === 0 || strpos($file, 'https://') === 0) {
-        continue;
+      if (_skinr_is_local_file($path . '/' . $data)) {
+        $data = $path . '/' . $data;
       }
-      $files[$key] = $path . '/' . $file;
+      $newfiles[$data] = $options;
     }
   }
+  $files = $newfiles;
+}
+
+/**
+ * Helper function to determine whether or not a given file is local or not.
+ */
+function _skinr_is_local_file($file) {
+  if (strpos($file, 'http://') === 0 || strpos($file, 'https://') === 0 || strpos($file, '/') === 0) {
+    return FALSE;
+  }
+  if (!file_exists($file)) {
+    return FALSE;
+  }
+  return TRUE;
 }
 
 /**
diff --git a/tests/skinr.test b/tests/skinr.test
index 87b3ae14c2ebc0de3d6634621125b9640e990454..c44798736e1c968a2001bb361a87ee046f267e8f 100644
--- a/tests/skinr.test
+++ b/tests/skinr.test
@@ -663,5 +663,11 @@ class SkinrDisplayTestCase extends SkinrWebTestCase {
 
     $js = drupal_get_path('module', 'skinr_test') . '/skinr_test.js';
     $this->assertRaw($js, t('Javascript was included on page.'));
+
+    $js = drupal_get_path('module', 'skinr_test') . '/skinr_test_advanced.css';
+    $this->assertRaw($js, t('Javascript with advanced settings was included on page.'));
+
+    $js = drupal_get_path('module', 'skinr_test') . '/skinr_test_data.css';
+    $this->assertRaw($js, t('Javascript with filename set in settings array was included on page.'));
   }
 }
diff --git a/tests/skinr_test/skinr_test.skinr.inc b/tests/skinr_test/skinr_test.skinr.inc
index 1893dfd3d20a4c1ce5dca0e54531da56440b2274..0e567fd7a4e5a65c50ec6e7877676dfd62da7b6f 100644
--- a/tests/skinr_test/skinr_test.skinr.inc
+++ b/tests/skinr_test/skinr_test.skinr.inc
@@ -29,7 +29,11 @@ function skinr_test_skinr_skin_info() {
     'theme hooks' => array('block', 'region'),
     'default status' => 1,
     'attached' => array(
-      'css' => array('skinr_test.css'),
+      'css' => array(
+        'skinr_test.css',
+        'skinr_test_advanced.css' => array('group' => CSS_THEME, 'weight' => 999),
+        array('data' => 'skinr_test_data.css', 'group' => CSS_THEME, 'weight' => 999),
+      ),
       'js' => array('skinr_test.js'),
     ),
     'options' => array(
diff --git a/tests/skinr_test/skinr_test_advanced.css b/tests/skinr_test/skinr_test_advanced.css
new file mode 100644
index 0000000000000000000000000000000000000000..ba9f6d38f034889b79a06b6591c592aaa62cfff8
--- /dev/null
+++ b/tests/skinr_test/skinr_test_advanced.css
@@ -0,0 +1,2 @@
+.font-advanced-1 { font-family: Arial, Helvetica, "Nimbus Sans L", "Liberation Sans", "FreeSans", sans-serif; }
+.font-advanced-2 { font-family: "Lucida Grande", "Lucida Sans Unicode", "DejaVu Sans", Arial, sans-serif; }
diff --git a/tests/skinr_test/skinr_test_data.css b/tests/skinr_test/skinr_test_data.css
new file mode 100644
index 0000000000000000000000000000000000000000..99ccc463d357eceb3d8e3e9e531398a11ce2005b
--- /dev/null
+++ b/tests/skinr_test/skinr_test_data.css
@@ -0,0 +1,2 @@
+.font-data-1 { font-family: Arial, Helvetica, "Nimbus Sans L", "Liberation Sans", "FreeSans", sans-serif; }
+.font-data-2 { font-family: "Lucida Grande", "Lucida Sans Unicode", "DejaVu Sans", Arial, sans-serif; }
