diff --git a/src/linkahead/apiutils.py b/src/linkahead/apiutils.py
index 35d33c8c6ab2d9fc0224f9755a4f06f376a14797..8ff5b649b4d093053917217b7555730c828ced3c 100644
--- a/src/linkahead/apiutils.py
+++ b/src/linkahead/apiutils.py
@@ -322,7 +322,7 @@ def compare_entities(entity0: Entity, entity1: Entity,
                         continue
                     # Compare Entities
                     if (compare_referenced_records and
-                        isinstance(val0, Entity) and isinstance(val1, Entity)):
+                            isinstance(val0, Entity) and isinstance(val1, Entity)):
                         try:
                             same = empty_diff(val0, val1, False,
                                               entity_name_id_equivalency)
@@ -446,7 +446,7 @@ def empty_diff(old_entity: Entity, new_entity: Entity,
         Entity(id=100) == 100 == "100".
     """
     olddiff, newdiff = compare_entities(old_entity, new_entity,
-        compare_referenced_records, entity_name_id_equivalency)
+                                        compare_referenced_records, entity_name_id_equivalency)
     for diff in [olddiff, newdiff]:
         for key in ["parents", "properties"]:
             if len(diff[key]) > 0:
@@ -512,8 +512,8 @@ def merge_entities(entity_a: Entity,
 
     # Compare both entities:
     diff_r1, diff_r2 = compare_entities(entity_a, entity_b,
-        entity_name_id_equivalency=merge_id_with_resolved_entity,
-        compare_referenced_records=merge_references_with_empty_diffs)
+                                        entity_name_id_equivalency=merge_id_with_resolved_entity,
+                                        compare_referenced_records=merge_references_with_empty_diffs)
 
     # Go through the comparison and try to apply changes to entity_a:
     for key in diff_r2["parents"]:
diff --git a/src/linkahead/common/models.py b/src/linkahead/common/models.py
index d3ef1e525a347833d341d399bb08a3dc511b32ae..e23786edb846b5356ab09772af5e96a49eb6f2b3 100644
--- a/src/linkahead/common/models.py
+++ b/src/linkahead/common/models.py
@@ -2522,8 +2522,8 @@ class PropertyList(list):
 
         return xml2str(xml)
 
-    def filter(self, prop:Property = None, pid:Union[str, int] = None,
-               name:str = None, check_wrapped: bool = True) -> list:
+    def filter(self, prop: Property = None, pid: Union[str, int] = None,
+               name: str = None, check_wrapped: bool = True) -> list:
         """
         Return all Properties from the given PropertyList that match the
         selection criteria.
@@ -2693,8 +2693,8 @@ class ParentList(list):
 
         return xml2str(xml)
 
-    def filter(self, parent:Parent = None, pid:Union[str, int] = None,
-               name:str = None, check_wrapped: bool = True) -> list:
+    def filter(self, parent: Parent = None, pid: Union[str, int] = None,
+               name: str = None, check_wrapped: bool = True) -> list:
         """
         Return all Parents from the given ParentList that match the selection
         criteria.
@@ -5498,15 +5498,15 @@ def delete(ids: Union[list[int], range], raise_exception_on_error: bool = True):
     return c.delete(raise_exception_on_error=raise_exception_on_error)
 
 
-def _filter_entity_list(listobject, entity:Entity = None, pid:Union[str, int] = None,
-                        name:str = None, check_wrapped:bool = True) -> list:
+def _filter_entity_list(listobject, entity: Entity = None, pid: Union[str, int] = None,
+                        name: str = None, check_wrapped: bool = True) -> list:
     """
     Return all elements from the given list that match the selection criteria.
 
     You can provide name or ID and all matching elements will be returned.
     If both name and ID are given, elements matching either criterion will be
     returned. 
-    
+
     If an Entity is given, neither name nor ID may be set. In this case, only
     elements matching both name and ID of the Entity are returned, as long as
     name and ID are both set.
diff --git a/unittests/test_apiutils.py b/unittests/test_apiutils.py
index c11cecdf2175b12723fc9ddecf963266d967b6c9..2688caedb38f88c00055aa1d0cebafb7f3cbc0c5 100644
--- a/unittests/test_apiutils.py
+++ b/unittests/test_apiutils.py
@@ -136,7 +136,6 @@ def test_compare_entities():
     assert "tests_234234" in diff_r1["properties"]
     assert "tests_TT" in diff_r2["properties"]
 
-
     # test compare units of properties
     r1 = db.Record()
     r2 = db.Record()
@@ -174,7 +173,7 @@ def test_compare_entities_battery():
     prop2 = db.Property(name="Property 2")
     prop3 = db.Property()
 
-    ##  Basic tests for Properties
+    # Basic tests for Properties
     prop_settings = {"datatype": db.REFERENCE, "description": "desc of prop",
                      "value": db.Record().add_parent(par3), "unit": '°'}
     t1 = db.Record().add_parent(db.RecordType())
@@ -226,7 +225,7 @@ def test_compare_entities_battery():
     diff_0[1]["properties"].pop("value copy")
     assert diff_0 == diff_1
 
-    ##  Basic tests for Parents
+    # Basic tests for Parents
     t3 = db.Record().add_parent(db.RecordType("A")).add_parent(db.Record("B"))
     t4 = db.Record().add_parent(db.RecordType("A"))
     assert compare_entities(t3, t4)[0]['parents'] == ['B']
@@ -241,13 +240,13 @@ def test_compare_entities_battery():
     t4.add_parent(db.RecordType("B")).add_parent(db.Record("A"))
     assert empty_diff(t3, t4)
 
-    ##  Basic tests for special attributes
+    # Basic tests for special attributes
     prop_settings = {"id": 42, "name": "Property",
                      "datatype": db.LIST(db.REFERENCE), "value": [db.Record()],
                      "unit": '€', "description": "desc of prop"}
-    alt_settings  = {"id": 64, "name": "Property 2",
-                     "datatype": db.LIST(db.TEXT), "value": [db.RecordType()],
-                     "unit": '€€', "description": " ę Ě ப ཾ ཿ ∛ ∜ ㅿ ㆀ 값 "}
+    alt_settings = {"id": 64, "name": "Property 2",
+                    "datatype": db.LIST(db.TEXT), "value": [db.RecordType()],
+                    "unit": '€€', "description": " ę Ě ப ཾ ཿ ∛ ∜ ㅿ ㆀ 값 "}
     t5 = db.Property(**prop_settings)
     t6 = db.Property(**prop_settings)
     assert empty_diff(t5, t6)
@@ -310,7 +309,7 @@ def test_compare_entities_battery():
                       db.Property(value=db.Record(id=101)),
                       compare_referenced_records=True)
 
-    ##  Special cases
+    # Special cases
     # Files
     assert not empty_diff(db.File(path='ABC', file=StringIO("ABC")),
                           db.File(path='ABC', file=StringIO("Other")))
@@ -336,7 +335,7 @@ def test_compare_entities_battery():
     prop4.value = db.Record(id=12)
     prop4_c.value = '12'
     prop4.add_property(db.Property(name="diff", datatype=db.LIST(db.REFERENCE),
-                                     value=[12, db.Record(id=13), par1, "abc%"]))
+                                   value=[12, db.Record(id=13), par1, "abc%"]))
     prop4_c.add_property(db.Property(name="diff", datatype=db.LIST(db.REFERENCE),
                                      value=[db.Record(id=12), "13", par1, "abc%"]))
     assert not empty_diff(prop4, prop4_c, entity_name_id_equivalency=False)
@@ -411,7 +410,6 @@ def test_compare_special_properties():
         assert len(diff_r1["properties"]) == 0
         assert len(diff_r2["properties"]) == 0
 
-
     # compare Property objects
     p1 = db.Property()
     p2 = db.Property()
diff --git a/unittests/test_entity.py b/unittests/test_entity.py
index 8a41ca6fe6025b4ea45334e493215e730be5d895..66cffbefe207820ddde1463f62a88788beb7df9a 100644
--- a/unittests/test_entity.py
+++ b/unittests/test_entity.py
@@ -179,7 +179,7 @@ def test_filter():
     r6 = Record(id=105, name="R")
     test_ents = [rt1, rt2, rt3, p1, p2, p3, p4, p5, p6, r1, r2, r3, r4, r5, r6]
 
-    ###   Setup
+    # Setup
     t1 = Property()
     t1_props, t1_pars = t1.properties, t1.parents
     t2 = Record()
@@ -192,10 +192,10 @@ def test_filter():
             assert ent not in coll
             assert ent not in coll.filter(ent)
 
-    ###   Checks with each type
+    # Checks with each type
     for t, t_props, t_pars in [(t1, t1_props, t1_pars), (t2, t2_props, t2_pars),
                                (t3, t3_props, t3_pars)]:
-        ##  Properties
+        # Properties
         # Basic Checks
         t.add_property(p1)
         t.add_property(p3)
@@ -213,7 +213,7 @@ def test_filter():
             assert entity not in t_props.filter(pid=100)
             assert p2 in t_props.filter(entity)
 
-        ##  Parents
+        # Parents
         # Filtering with both name and id
         t.add_parent(r3)
         t.add_parent(r5)
@@ -235,6 +235,6 @@ def test_filter():
         for ent in [rt1, p1, p2, r1, r2]:
             filtered = t_pars.filter(ent)
             for ent2 in [rt1, p1, p2, r1, r2]:
-                    assert ent2 in filtered
+                assert ent2 in filtered
             assert ent in t_pars.filter(pid=100)
             assert ent in t_pars.filter(pid="100")