diff --git a/misc/cron/updatetoken.php b/misc/cron/updatetoken.php
index ff02e4f30ab0ac2220994fb98c810789b062b9a5..4638f8bd27b3f35dff8acdbcedd7b1e13b4e9388 100644
--- a/misc/cron/updatetoken.php
+++ b/misc/cron/updatetoken.php
@@ -40,8 +40,7 @@ function getPiwikDomain()
 {
     foreach($_SERVER['argv'] as $param) {
         $pattern = '--piwik-domain=';
-        $equalSign = strpos($param, $pattern);
-        if($equalSign !== false) {
+        if(false !== strpos($param, $pattern)) {
             return substr($param, strlen($pattern));
         }
     }
diff --git a/plugins/CoreAdminHome/CustomLogo.php b/plugins/CoreAdminHome/CustomLogo.php
index eda7ef06383f94d40940516eb9c79951e2086ed3..76f328e139289d4b5e7ab838cdbd0fe42becd49c 100644
--- a/plugins/CoreAdminHome/CustomLogo.php
+++ b/plugins/CoreAdminHome/CustomLogo.php
@@ -11,6 +11,7 @@ namespace Piwik\Plugins\CoreAdminHome;
 use Piwik\Config;
 use Piwik\Filesystem;
 use Piwik\Option;
+use Piwik\Plugin\Manager;
 use Piwik\SettingsPiwik;
 
 class CustomLogo
@@ -114,7 +115,12 @@ class CustomLogo
 
         $logo = $defaultLogo;
 
-        $themeName = \Piwik\Plugin\Manager::getInstance()->getThemeEnabled()->getPluginName();
+        $theme = \Piwik\Plugin\Manager::getInstance()->getThemeEnabled();
+        if(!$theme) {
+            $themeName = Manager::DEFAULT_THEME;
+        } else {
+            $themeName = $theme->getPluginName();
+        }
         $themeLogo = sprintf($themeLogo, $themeName);
 
         if (file_exists($pathToPiwikRoot . '/' . $themeLogo)) {