Fixed check for dirty in pkg_unpack