diff --git a/init_user_state.py b/init_user_state.py
index f539d2cd3805d3a9532d84840784c83d44d73a50..15f9479925c109f9e0b82181458b2b5207188895 100644
--- a/init_user_state.py
+++ b/init_user_state.py
@@ -26,7 +26,7 @@ size = 1000
 db = dataset.connect(f"sqlite:///{rcfg.db_path}/user_reg.db")
 table = db["user_state"]
 
-if table.__len__() > 0 and not args.force:
+if len(table) > 0 and not args.force:
     print("table user_state not empty, abort.")
     sys.exit()
 
diff --git a/prod_rmq_agents/get-next-uid-gid.py b/prod_rmq_agents/get-next-uid-gid.py
index a6a6d531bfa2f293a5634846064bbfe34381f458..0fc40c801520a4c2623d63be18c83640fa7cda6f 100644
--- a/prod_rmq_agents/get-next-uid-gid.py
+++ b/prod_rmq_agents/get-next-uid-gid.py
@@ -31,7 +31,7 @@ def create_account(msg):
     msg["success"] = False
 
     # Bright command to create user
-    if str(rcfg.bright_cm_version).split(".")[0] == "8":
+    if str(rcfg.bright_cm_version).split(".", maxsplit=1)[0] == "8":
         cmd = "/cm/local/apps/cmd/bin/cmsh -c "
         cmd += f'"user; add {username}; set userid {uid}; set email {email};'
         cmd += f'set commonname \\"{fullname}\\"; '