diff --git a/app/views/admin/plugin/edit_automaticupdate.php b/app/views/admin/plugin/edit_automaticupdate.php
index 2831427e88a19200cb76d9f681643aba5e2d66cd..7e87c319a197c14f7dbb761c6a33767f3274cee9 100644
--- a/app/views/admin/plugin/edit_automaticupdate.php
+++ b/app/views/admin/plugin/edit_automaticupdate.php
@@ -3,8 +3,7 @@
  * @var Admin_PluginController $controller
  * @var array $plugin
  */
-?>
-<?
+
 if (mb_strpos($_SERVER['SERVER_NAME'], ':') !== false) {
     list($_SERVER['SERVER_NAME'], $_SERVER['SERVER_PORT']) =
         explode(':', $_SERVER['SERVER_NAME']);
@@ -26,7 +25,7 @@ if ($_SERVER['HTTPS'] == 'on' && $_SERVER['SERVER_PORT'] != 443 ||
         <?= $m ?>
     <? endforeach ?>
 </div>
-<form action="<?= $controller->url_for('admin/plugin/edit_automaticupdate/'.$plugin['id']) ?>" method="post" class="default" data-dialog="size=auto;reload-on-close">
+<form action="<?= $controller->link_for('admin/plugin/edit_automaticupdate', $plugin['id'] ?? null) ?>" method="post" class="default" data-dialog="size=auto;reload-on-close">
     <?= CSRFProtection::tokenTag() ?>
     <input type="hidden" name="studip_ticket" value="<?= get_ticket() ?>">
     <?= MessageBox::info(_("Sie können gitlab, github.com oder dem neuen Stud.IP-Plugin-Marktplatz mitteilen, dass Ihr Stud.IP per Webhook über Änderungen im Code des Plugins benachrichtigt werden soll.")) ?>
@@ -34,15 +33,16 @@ if ($_SERVER['HTTPS'] == 'on' && $_SERVER['SERVER_PORT'] != 443 ||
         <legend><?= _("Einstellungen von Stud.IP") ?></legend>
         <label>
             <?= _("URL, von der das Plugin als ZIP-Datei bezogen werden soll") ?>
-            <input type="url" name="automatic_update_url" value="<?= htmlReady($plugin['automatic_update_url']) ?>">
+            <input type="url" name="automatic_update_url" value="<?= htmlReady($plugin['automatic_update_url'] ?? '') ?>">
         </label>
         <label>
             <?= _("Automatisches Update absichern über Sicherheitstoken (optional)") ?>
-            <input type="checkbox" name="use_security_token" value="1"<?= $plugin['automatic_update_secret'] || !$plugin['automatic_update_url'] ? " checked" : "" ?>>
+            <input type="checkbox" name="use_security_token" value="1"
+                   <?= !empty($plugin['automatic_update_secret']) || empty($plugin['automatic_update_url']) ? " checked" : "" ?>>
         </label>
     </fieldset>
 
-    <? if ($plugin['automatic_update_url']) : ?>
+    <? if (!empty($plugin['automatic_update_url'])) : ?>
     <fieldset>
         <legend><?= _("Daten für das bereitstellende System") ?></legend>
         <p class="info">
diff --git a/lib/classes/LockRules.class.php b/lib/classes/LockRules.class.php
index 48a43790a74ed0254fc015348cce999f2c4153ba..59679db6258ecd2c518d5bae158a6a99f005c547 100644
--- a/lib/classes/LockRules.class.php
+++ b/lib/classes/LockRules.class.php
@@ -85,7 +85,8 @@ class LockRules {
      */
     public static function getObjectRule($object_id, $renew = false, $object_type = null)
     {
-        if(!array_key_exists($object_id, self::$lockmap) || $renew) {
+        if (!array_key_exists($object_id, self::$lockmap) || $renew) {
+            self::$lockmap[$object_id] = null;
             if ($object_type === null) {
                 $object_type = get_object_type($object_id, words('sem inst user'));
             }
@@ -98,12 +99,10 @@ class LockRules {
                 if ($lr) {
                     self::$lockmap[$object_id] = $lr->getId();
                     self::$lockrules[$lr->getId()] = $lr;
-                } else {
-                    self::$lockmap[$object_id] = null;
                 }
             }
         }
-        return self::$lockmap[$object_id] ? self::$lockrules[self::$lockmap[$object_id]] : null;
+        return self::$lockrules[self::$lockmap[$object_id]] ?? null;
     }
 
     /**
diff --git a/lib/functions.php b/lib/functions.php
index bce4215064b93a69e7d4062e456d15a3252a99b1..e5ac0c957bbb90ab27349fcda41bfa3cadf51615 100644
--- a/lib/functions.php
+++ b/lib/functions.php
@@ -73,15 +73,16 @@ function get_object_name($range_id, $object_type)
         $statement->execute([$range_id]);
         $row = $statement->fetch(PDO::FETCH_ASSOC);
 
-        if ($SEM_TYPE[$row['status']]['name'] == $SEM_TYPE_MISC_NAME) {
+        if (!$row) {
+            $name = _('Unbekannt');
             $type = _('Veranstaltung');
         } else {
-            $type = $SEM_TYPE[$row['status']]['name'];
-        }
-        if (!$type) {
-            $type = _('Veranstaltung');
+            $name = $row['Name'];
+            $type = $SEM_TYPE[$row['status']]['name'] ?? _('Veranstaltung');
+            if ($type === $SEM_TYPE_MISC_NAME) {
+                $type = _('Veranstaltung');
+            }
         }
-        $name = $row['Name'];
     } else if ($object_type == 'inst' || $object_type == 'fak') {
         $query = "SELECT type, Name FROM Institute WHERE Institut_id = ?";
         $statement = DBManager::get()->prepare($query);