Index: trunk/python/pyregfi/__init__.py
===================================================================
--- trunk/python/pyregfi/__init__.py	(revision 214)
+++ trunk/python/pyregfi/__init__.py	(revision 215)
@@ -31,4 +31,7 @@
 regfi.regfi_log_set_mask.restype = c_bool
 
+regfi.regfi_get_rootkey.argtypes = [POINTER(REGFI_FILE)]
+regfi.regfi_get_rootkey.restype = POINTER(REGFI_NK)
+
 regfi.regfi_free_record.argtypes = [c_void_p]
 regfi.regfi_free_record.restype = None
@@ -64,4 +67,7 @@
                                    c_uint32]
 regfi.regfi_get_value.restype = POINTER(REGFI_VK)
+
+regfi.regfi_get_parentkey.argtypes = [POINTER(REGFI_FILE), POINTER(REGFI_NK)]
+regfi.regfi_get_parentkey.restype = POINTER(REGFI_NK)
 
 regfi.regfi_iterator_new.argtypes = [POINTER(REGFI_FILE), REGFI_ENCODING]
@@ -122,5 +128,5 @@
     if msgs == None:
         return ''
-    return msgs.decode('ascii')
+    return msgs.decode('utf-8')
 
 
@@ -132,4 +138,16 @@
     for i in range(0,length):
         ret_val[i] = char_pointer[i][0]
+
+    return ret_val
+
+
+def _strlist2charss(str_list):
+    ret_val = []
+    for s in str_list:
+        ret_val.append(s.encode('utf-8', 'replace'))
+
+    ret_val = (c_char_p*(len(str_list)+1))(*ret_val)
+    # Terminate the char** with a NULL pointer
+    ret_val[-1] = 0
 
     return ret_val
@@ -155,11 +173,17 @@
 
     def __init__(self, hive, base):
+        if not hive:
+            raise Exception("Could not create _StructureWrapper,"
+                            + " hive is NULL.  Current log:\n"
+                            + GetLogMessages())
+        if not base:
+            raise Exception("Could not create _StructureWrapper,"
+                            + " base is NULL.  Current log:\n"
+                            + GetLogMessages())
         self._hive = hive
-        # XXX: check for NULL here, throw an exception if so.
         self._base = base
 
     def __del__(self):
         regfi.regfi_free_record(self._base)
-        hive = None
 
     def __getattr__(self, name):
@@ -172,5 +196,4 @@
         return (not self.__eq__(other))
 
-## Registry key 
 class Key(_StructureWrapper):
     pass
@@ -248,5 +271,5 @@
 
         elem = self._get_element(self._hive.file, self._key._base,
-                                c_uint32(self._current))
+                                 c_uint32(self._current))
         self._current += 1
         return self._constructor(self._hive, elem)
@@ -268,4 +291,5 @@
 
 
+## Registry key 
 class Key(_StructureWrapper):
     values = None
@@ -295,5 +319,17 @@
     def fetch_security(self):
         return Security(self._hive,
-                        regfi.regfi_fetch_sk(self._hive.file, self.base))
+                        regfi.regfi_fetch_sk(self._hive.file, self._base))
+
+    def get_parent(self):
+        parent_base = regfi.regfi_get_parentkey(self._hive.file, self._base)
+        if parent_base:
+            return Key(self._hive, parent_base)
+
+        return None
+
+    def is_root(self):
+        # This is quicker than retrieving the root key for comparison and
+        # is more trustworthy than trusting the key's flags.
+        return ((self._hive.root_cell+REGFI_REGF_SIZE) == self.offset)
 
 
@@ -402,4 +438,8 @@
         return HiveIterator(self)
 
+    def get_root(self):
+        return Key(self, regfi.regfi_get_rootkey(self.file))
+
+
     ## Creates a @ref HiveIterator initialized at the specified path in
     #  the hive. 
@@ -479,12 +519,8 @@
 
     def descend(self, path):
-        #set up generator
-        cpath = (bytes(p,'ascii') for p in path) 
-
-        # evaluate generator and create char* array
-        apath = (c_char_p*len(path))(*cpath)
+        cpath = _strlist2charss(path)
 
         # XXX: Use non-generic exception
-        if not regfi.regfi_iterator_walk_path(self.iter,apath):
+        if not regfi.regfi_iterator_walk_path(self.iter, cpath):
             raise Exception('Could not locate path.\n'+GetLogMessages())
 
Index: trunk/python/pyregfi/structures.py
===================================================================
--- trunk/python/pyregfi/structures.py	(revision 214)
+++ trunk/python/pyregfi/structures.py	(revision 215)
@@ -13,4 +13,5 @@
 
 REGFI_DATA_TYPE = c_uint32
+REGFI_REGF_SIZE = 0x1000 
 
 # Registry value data types
