diff --git a/createrepo.spec b/createrepo.spec
index 0d4bbd8..57a0196 100644
--- a/createrepo.spec
+++ b/createrepo.spec
@@ -11,7 +11,7 @@ URL: http://createrepo.baseurl.org/
 BuildRoot: %{_tmppath}/%{name}-%{version}root
 BuildArchitectures: noarch
 Requires: python >= 2.1, rpm-python, rpm >= 0:4.1.1, libxml2-python
-Requires: yum-metadata-parser, yum >= 3.2.23
+Requires: yum-metadata-parser, yum >= 3.2.23, python-deltarpm
 
 %description
 This utility will generate a common metadata repository from a directory of
diff --git a/createrepo/__init__.py b/createrepo/__init__.py
index 4601a15..0ffe6cb 100644
--- a/createrepo/__init__.py
+++ b/createrepo/__init__.py
@@ -298,8 +298,8 @@ class MetaDataGenerator:
                     self.callback.errorlog(_('cannot get to file: %s') % fn)
                 if os.path.getctime(fn) > self.conf.mdtimestamp:
                     return False
-                else:
-                    return True
+            
+            return True
                 
         return False
 
@@ -543,6 +543,17 @@ class MetaDataGenerator:
                                       (othernode, self.otherfile)):
                     if node is None:
                         break
+
+                    if self.conf.baseurl:
+                        anode = node.children
+                        while anode is not None:
+                            if anode.type != "element":
+                                anode = anode.next
+                                continue
+                            if anode.name == "location":
+                                anode.setProp('xml:base', self.conf.baseurl)
+                            anode = anode.next
+
                     output = node.serialize('UTF-8', self.conf.pretty)
                     if output:
                         outfile.write(output)
diff --git a/createrepo/deltarpms.py b/createrepo/deltarpms.py
index 26a6715..d14d3fa 100644
--- a/createrepo/deltarpms.py
+++ b/createrepo/deltarpms.py
@@ -18,7 +18,7 @@
 import os.path
 import commands
 from yum import misc
-import gzip
+import deltarpm
 from utils import MDError
 
 class DeltaRPMPackage:
@@ -44,17 +44,16 @@ class DeltaRPMPackage:
         os.lseek(fd, 0, 0)
         fo = os.fdopen(fd, 'rb')
         self.csum = misc.checksum(self.csum_type, fo)
-        fo.seek(int(self.po.hdrend))
-        self._getOldInfo(fo)
         del fo
         del fd
+        self._getDRPMInfo(os.path.join(basedir, filename))
                     
     def _stringToNEVR(self, string):
         i = string.rfind("-", 0, string.rfind("-")-1)
         name = string[:i]
         (epoch, ver, rel) = self._stringToVersion(string[i+1:])
         return (name, epoch, ver, rel)
-        
+
     def _getLength(self, in_data):
         length = 0
         for val in in_data:
@@ -62,27 +61,12 @@ class DeltaRPMPackage:
             length += ord(val)
         return length
         
-    def _getOldInfo(self, fo):
-        try:
-            compobj = gzip.GzipFile("", "rb", 9, fo)
-        except:
-            raise zlibError("Data not stored in gzip format")
-            
-        if compobj.read(4)[:3] != "DLT":
-            raise Exception("Not a deltarpm")
+    def _getDRPMInfo(self, filename):
+        d = deltarpm.readDeltaRPM(filename)
+        self.oldnevrstring = d['old_nevr']
+        self.oldnevr = self._stringToNEVR(d['old_nevr'])
+        self.sequence = d['seq']
         
-        nevr_length = self._getLength(compobj.read(4))
-        nevr = compobj.read(nevr_length).strip("\x00")
-        seq_length = self._getLength(compobj.read(4))
-        seq = compobj.read(seq_length)
-        hex_seq = ""
-        for char in seq:
-            hex_seq += str("%02x" % ord(char))
-        self.oldnevrstring = nevr
-        self.oldnevr = self._stringToNEVR(nevr)
-        self.sequence = hex_seq
-        compobj.close()
-            
     def _stringToVersion(self, strng):
         i = strng.find(':')
         if i != -1:
diff --git a/createrepo/readMetadata.py b/createrepo/readMetadata.py
index 285e54d..6711d30 100644
--- a/createrepo/readMetadata.py
+++ b/createrepo/readMetadata.py
@@ -136,7 +136,7 @@ class MetadataIndex(object):
                 if self.opts.get('verbose'):
                     print _("Size (%i -> %i) changed for file %s") % (size,st.st_size,filepath)
                 return
-            if st.st_mtime != mtime:
+            if int(st.st_mtime) != mtime:
                 if self.opts.get('verbose'):
                     print _("Modification time changed for %s") % filepath
                 return
