diff --git a/src/linkahead/common/administration.py b/src/linkahead/common/administration.py
index 92129a4d4918a5f8ac25c80d7e7107431b227557..cb43fc1e07a20dcf34bf2a25089bf821c7d49202 100644
--- a/src/linkahead/common/administration.py
+++ b/src/linkahead/common/administration.py
@@ -38,7 +38,7 @@ from ..exceptions import (EntityDoesNotExistError, HTTPClientError,
                           ServerConfigurationException)
 from .utils import xml2str
 
-from typing import Dict, Optional, TYPE_CHECKING
+from typing import Dict, Optional, TYPE_CHECKING, Union
 if TYPE_CHECKING:
     from ..common.models import Entity
 
@@ -218,7 +218,7 @@ def _insert_user(name: str,
                  email: Optional[str] = None,
                  entity: Optional[Entity] = None, **kwargs):
     con = get_connection()
-    params = {"username": name}
+    params: Dict[str, Union[str, Entity]] = {"username": name}
 
     if password is not None:
         params["password"] = password
@@ -427,7 +427,7 @@ priority : bool, optional
     def _parse_element(elem: etree._Element):
         permission = elem.get("permission")
         if permission is None:
-            raise ValueError(f"Permission is missing in PermissionRule xml: {etree.tostring(elem)}")
+            raise ValueError(f"Permission is missing in PermissionRule xml: {elem}")
         priority = PermissionRule._parse_boolean(elem.get("priority"))
         return PermissionRule(elem.tag, permission, priority if priority is not None else False)