diff --git a/src/mio/util.py b/src/mio/util.py
index 1a09fe712c5f98a026cdb94ad3115e95400ba3bc..bd47c0eb16d5d0919bfdca464a3f2f1e149924c3 100755
--- a/src/mio/util.py
+++ b/src/mio/util.py
@@ -90,6 +90,13 @@ def uid(owner):
                 log(NORMAL, "Deferring uid lookup for '%s'" % owner)
                 return False
 
+        def __ne__(self, other):
+            try:
+                return int(self) != other
+            except KeyError:
+                log(NORMAL, "Deferring uid lookup for '%s'" % owner)
+                return False
+
     return deferred_uid()
 
 def gid(group):
@@ -111,7 +118,14 @@ def gid(group):
             except KeyError:
                 log(NORMAL, "Deferring gid lookup for '%s'" % group)
                 return False
-            
+
+        def __ne__(self, other):
+            try:
+                return int(self) != other
+            except KeyError:
+                log(NORMAL, "Deferring gid lookup for '%s'" % group)
+                return False
+
     return deferred_gid()
 
 def owner(decl):