Small modifications to packageArchive()