diff --git a/secrules/rules05.py b/secrules/rules05.py
index 98a3d3965eaea42bcf7a5d8eaa28d324f9cc3860_c2VjcnVsZXMvcnVsZXMwNS5weQ==..9050c7b39add230561b243dd179a6191ac13dc5b_c2VjcnVsZXMvcnVsZXMwNS5weQ== 100644
--- a/secrules/rules05.py
+++ b/secrules/rules05.py
@@ -27,7 +27,7 @@
     for u in all_users.values():
         if not (u.flags & uaidef.UAI_M_DISCTLY):
             if fmt:
-                print>>fo, '0501�3�', u.username
+                print>>fo, '0501�3�', u.username
             else:
                 print>>fo, u.username
 
@@ -43,7 +43,7 @@
     for u in all_users.values():
         if not (u.flags & uaidef.UAI_M_DEFCLI):
             if fmt:
-                print>>fo, '0502�3�', u.username
+                print>>fo, '0502�3�', u.username
             else:
                 print>>fo, u.username
 
@@ -63,7 +63,7 @@
         if (u.flags & uaidef.UAI_M_CAPTIVE):
             if (u.flags & uaidef.UAI_M_LOCKPWD) or (u.uic_group <= maxsysgroup):
                 if fmt:
-                    print>>fo, '0503�2�', u.username
+                    print>>fo, '0503�2�', u.username
                 else:
                     print>>fo, u.username, u.uic_group
 
@@ -82,7 +82,7 @@
     for u in all_users.values():
         if (u.flags & uaidef.UAI_M_CAPTIVE) and ((u.uic_group <= maxsysgroup) or (u.prccnt != 0)):
             if fmt:
-                print>>fo, '0504�2�', u.username
+                print>>fo, '0504�2�', u.username
             else:
                 print>>fo, u.username, u.uic_group, u.prccnt
 
@@ -102,7 +102,7 @@
     for u in all_users.values():
         if (u.lastlogin_i == 0) and (u.lastlogin_n == 0) and not (u.flags & uaidef.UAI_M_DISACNT):
             if fmt:
-                print>>fo, '0506�2�', u.username
+                print>>fo, '0506�2�', u.username
             else:
                 print>>fo, u.username
 
@@ -123,7 +123,7 @@
     for u in all_users.values():
         if ((u.lastlogin_i < limit_time) and (u.lastlogin_n < limit_time )) and not (u.flags & uaidef.UAI_M_DISACNT):
             if fmt:
-                print>>fo, '0507�2�', u.username
+                print>>fo, '0507�2�', u.username
             else:
                 print>>fo, u.username
 
@@ -141,7 +141,7 @@
     for u in all_users.values():
         if (u.flags & uaidef.UAI_M_DISACNT):
             if fmt:
-                print>>fo, '0508�3�', u.username
+                print>>fo, '0508�3�', u.username
             else:
                 print>>fo, u.username
 
@@ -156,6 +156,8 @@
         print>>fo, 'Rule 0509'
         print>>fo, '========='
 
+    current_time = starlet.bintim(starlet.asctim()[1])[1]
+
     for u in all_users.values():
         if (0 < u.expiration < current_time):
             if fmt:
@@ -159,7 +161,7 @@
     for u in all_users.values():
         if (0 < u.expiration < current_time):
             if fmt:
-                print>>fo, '0509�3�', u.username
+                print>>fo, '0509�3�', u.username
             else:
                 print>>fo, u.username
 
@@ -190,7 +192,7 @@
         r = lib.getsyi(p[1])[1]
         if cmp(r, p[2]) not in p[3:]:
             if fmt:
-                print>>fo, '0510�2�', p[0]
+                print>>fo, '0510�2�', p[0]
             else:
                 print>>fo, p[0]