diff --git a/test/remote_test.py b/test/remote_test.py
index e90ccb2..bc6d707 100644
--- a/test/remote_test.py
+++ b/test/remote_test.py
@@ -43,14 +43,16 @@
 
     def __getattr__(self, attr):
         if attr[0] == '_':
-            raise AttributeError
+            if not (attr.startswith('__') and attr.endswith('__')):
+                raise AttributeError
         self._path.append(attr)
         return self
 
     def __setattr__(self, attr, val):
         if attr[0] == '_':
-            super(RemoteClassAttr, self).__setattr__(attr, val)
-            return
+            if not (attr.startswith('__') and attr.endswith('__')):
+                super(RemoteClassAttr, self).__setattr__(attr, val)
+                return
         self._path.append(attr)
         self._remote._remote_exec(RemoteClass.SETATTR, self.path_to_str(),
                                   True, value=val)
@@ -114,15 +116,17 @@
 
     def __getattr__(self, attr):
         if attr[0] == '_' or not self.is_alive():
-            if hasattr(super(RemoteClass, self), '__getattr__'):
-                return super(RemoteClass, self).__getattr__(attr)
-            raise AttributeError
+            if not (attr.startswith('__') and attr.endswith('__')):
+                if hasattr(super(RemoteClass, self), '__getattr__'):
+                    return super(RemoteClass, self).__getattr__(attr)
+                raise AttributeError
         return RemoteClassAttr(self, attr)
 
     def __setattr__(self, attr, val):
         if attr[0] == '_' or not self.is_alive():
-            super(RemoteClass, self).__setattr__(attr, val)
-            return
+            if not (attr.startswith('__') and attr.endswith('__')):
+                super(RemoteClass, self).__setattr__(attr, val)
+                return
         setattr(RemoteClassAttr(self, None), attr, val)
 
     def _remote_exec(self, op, path=None, ret=True, *args, **kwargs):
@@ -241,7 +245,8 @@
         # copy at least serializable attributes and properties
         for name, member in inspect.getmembers(obj):
             if name[0] == '_':  # skip private members
-                continue
+                if not (name.startswith('__') and name.endswith('__')):
+                    continue
             if callable(member) and not isinstance(member, property):
                 continue
             if not self._serializable(member):
