diff --git a/advagg.missing.inc b/advagg.missing.inc
index 1c66786..2bd1ddd 100644
--- a/advagg.missing.inc
+++ b/advagg.missing.inc
@@ -869,7 +869,7 @@ function advagg_get_css_aggregate_contents(array $files, array $aggregate_settin
             $info_on_files['advagg:file:' . $row->filename_hash]['content_hash'] = $row->content_hash;
           }
         }
-        if ($info_on_files[$cid]['content_hash'] !== $file_contents_hash) {
+        if (isset($info_on_files[$cid]) == FALSE || $info_on_files[$cid]['content_hash'] !== $file_contents_hash) {
           // If the content hash doesn't match don't write the file.
           $write_aggregate = advagg_missing_file_not_readable($file, $aggregate_filename, FALSE);
         }
@@ -1408,8 +1408,7 @@ function advagg_save_data($uri, $data, $overwrite = FALSE) {
  *
  * @param string $string
  *   Input data to be sized in bytes.
- *
- * @link http://stackoverflow.com/a/3511239/231914
+ *   @link http://stackoverflow.com/a/3511239/231914.
  *
  * @return int
  *   Number of bytes this string uses.
diff --git a/advagg.module b/advagg.module
index 1447dad..2b497ef 100644
--- a/advagg.module
+++ b/advagg.module
@@ -1377,7 +1377,7 @@ function advagg_s3fs_upload_params_alter(&$upload_params) {
  * @param string $key
  *   A specific key available in the s3fs configuration. NULL by default.
  *
- * @return array | string | null
+ * @return array|string|null
  *   The full s3fs configuration settings, value of a specific key,
  *   or NULL if s3fs and the function do not exist.
  */
@@ -1551,7 +1551,7 @@ function advagg_modify_css_pre_render(array $elements) {
   // Put children elements into a reference array.
   $children = array();
   foreach ($elements as $key => &$value) {
-    if ($key !== '' && is_string($key) && $key[0] === '#') {
+    if ($key !== '' && is_string($key) && (0 === strpos($key, '#'))) {
       continue;
     }
     $children[$key] = &$value;
@@ -5740,7 +5740,7 @@ function advagg_get_remote_libraries_version($name, array $library, $use_cache =
         // Use vendor url if it's a github one.
         if (strpos($library['vendor url'], 'https://github.com/') === 0) {
           $parsed_vendor = @parse_url($library['vendor url']);
-          //Previously: https://rawgit.com{$parsed_vendor['path']}/master/{$library['version arguments']['file']} .
+          // Previously: https://rawgit.com{$parsed_vendor['path']}/master/{$library['version arguments']['file']} .
           $library['remote']['url'] = "https://cdn.jsdelivr.net/gh{$parsed_vendor['path']}@master/{$library['version arguments']['file']}";
         }
       }
