diff --git a/archival/ar.c b/archival/ar.c
index fbbc7aa..8ab3868 100644
--- a/archival/ar.c
+++ b/archival/ar.c
@@ -36,12 +36,13 @@
 	const int extract_to_file = 8;	/* extract contents of archive */
 	const int extract_to_stdout = 16;	/* extract to stdout */
 
+	FILE *src_file = NULL, *dst_file = NULL;
 	int funct = 0, opt=0;
-	int srcFd=0, dstFd=0;
 
-	ar_headers_t head, *extract_list=NULL;
+	ar_headers_t *head, *extract_list=NULL;
 
-	extract_list = (ar_headers_t *) xmalloc(sizeof(ar_headers_t));
+	extract_list = (ar_headers_t *) xcalloc(1, sizeof(ar_headers_t));
+	head = (ar_headers_t *) xcalloc(1, sizeof(ar_headers_t));
 
 	while ((opt = getopt(argc, argv, "ovtpx")) != -1) {
 		switch (opt) {
@@ -66,21 +67,22 @@
 	}
  
 	/* check the src filename was specified */
-	if (optind == argc)
+	if (optind == argc) {
 		show_usage();
-	
-	if ( (srcFd = open(argv[optind], O_RDONLY)) < 0)
+	}
+
+	if ( (src_file = wfopen(argv[optind], "r")) < 0) {
 		error_msg_and_die("Cannot read %s", argv[optind]);
+	}
 
 	optind++;	
-	head = get_ar_headers(srcFd);
-
+	head = get_ar_headers(src_file);
 	/* find files to extract or display */
 	/* search through argv and build extract list */
-	for (;optind<argc; optind++) {
+	for (;optind < argc; optind++) {
 		ar_headers_t *ar_entry;
-		ar_entry = (ar_headers_t *) xmalloc(sizeof(ar_headers_t));
-		ar_entry = &head;
+		ar_entry = (ar_headers_t *) xcalloc(1, sizeof(ar_headers_t));
+		ar_entry = head;
 		while (ar_entry->next != NULL) {
 			if (strcmp(argv[optind], ar_entry->name) == 0) {
 				ar_headers_t *tmp;
@@ -96,20 +98,20 @@
 
 	/* if individual files not found extract all files */	
 	if (extract_list->next==NULL) {
-		extract_list = &head;
+		extract_list = head;
 	}
-	
+
 	/* find files to extract or display */	
 	while (extract_list->next != NULL) {
 		if (funct & extract_to_file) {
-			dstFd = open(extract_list->name, O_WRONLY | O_CREAT, extract_list->mode);				
+			dst_file = wfopen(extract_list->name, "w");				
 		}
 		else if (funct & extract_to_stdout) {
-			dstFd = fileno(stdout);
+			dst_file = stdout;
 		}
 		if ((funct & extract_to_file) || (funct & extract_to_stdout)) {
-			lseek(srcFd, extract_list->offset, SEEK_SET);
-			copy_file_chunk(srcFd, dstFd, (off_t) extract_list->size);			
+			fseek(src_file, extract_list->offset, SEEK_SET);
+			copy_file_chunk(src_file, dst_file, (off_t) extract_list->size);			
 		}
 		if (funct & verbose) {
 			printf("%s %d/%d %8d %s ", mode_string(extract_list->mode), 
diff --git a/archival/dpkg.c b/archival/dpkg.c
index 55d97ad..d0728d9 100644
--- a/archival/dpkg.c
+++ b/archival/dpkg.c
@@ -565,8 +565,8 @@
 	int r = 0, i;
 	int status = TRUE;
 	char *cwd = xgetcwd(0);
-	char *src_file = NULL;
-	char *dst_file = NULL;
+	char *src_filename = NULL;
+	char *dst_filename = NULL;
 //	char *lst_file = NULL;
 	char *adminscripts[] = { "prerm", "postrm", "preinst", "postinst",
 			"conffiles", "md5sums", "shlibs", "templates" };
@@ -576,37 +576,37 @@
 	if(cwd==NULL)
 		exit(EXIT_FAILURE);
 	chdir("/");
-	deb_extract(dpkg_deb_extract, "/", pkg->file);
+	deb_extract(pkg->file, dpkg_deb_extract, "/");
 
 	/* Installs the package scripts into the info directory */
 	for (i = 0; i < sizeof(adminscripts) / sizeof(adminscripts[0]); i++) {
 		struct stat src_stat_buf;
-		int src_fd = 0, dst_fd = 0;
+		FILE *src_file = NULL, *dst_file = NULL;
 
 		/* The full path of the current location of the admin file */
-		src_file = xrealloc(src_file, strlen(dpkgcidir) + strlen(pkg->package) + strlen(adminscripts[i]) + 1);
-		sprintf(src_file, "%s%s/%s", dpkgcidir, pkg->package, adminscripts[i]);
+		src_filename = xrealloc(src_filename, strlen(dpkgcidir) + strlen(pkg->package) + strlen(adminscripts[i]) + 1);
+		sprintf(src_filename, "%s%s/%s", dpkgcidir, pkg->package, adminscripts[i]);
 
 		/* the full path of where we want the file to be copied to */
-		dst_file = xrealloc(dst_file, strlen(infodir) + strlen(pkg->package) + strlen(adminscripts[i]) + 1);
-		sprintf(dst_file, "%s%s.%s", infodir, pkg->package, adminscripts[i]);
+		dst_filename = xrealloc(dst_filename, strlen(infodir) + strlen(pkg->package) + strlen(adminscripts[i]) + 1);
+		sprintf(dst_filename, "%s%s.%s", infodir, pkg->package, adminscripts[i]);
 
 		/*
 		 * copy admin file to permanent home
 		 * NOTE: Maybe merge this behaviour into libb/copy_file.c
 		 */
-		if (lstat(src_file, &src_stat_buf) == 0) {
-			if ((src_fd = open(src_file, O_RDONLY)) != -1) {
-			 	if ((dst_fd = open(dst_file, O_WRONLY | O_CREAT, 0644)) == -1) {
+		if (lstat(src_filename, &src_stat_buf) == 0) {
+			if ((src_file = wfopen(src_filename, "r")) != NULL) {
+			 	if ((dst_file = wfopen(dst_filename, "w")) == NULL) {
 					status = FALSE;
-					perror_msg("Opening %s", dst_file);
+					perror_msg("Opening %s", dst_filename);
 				}
-				copy_file_chunk(src_fd, dst_fd, src_stat_buf.st_size);
-				close(src_fd);
-				close(dst_fd);
+				copy_file_chunk(src_file, dst_file, src_stat_buf.st_size);
+				fclose(src_file);
+				fclose(dst_file);
 			} else {
 				status = FALSE;
-				error_msg("couldnt open [%s]\n", src_file);
+				error_msg("couldnt open [%s]\n", src_filename);
 			}
 		}
 	}
@@ -671,7 +671,7 @@
 	strcat(tmp_name, pkg->package);
 
 	/* extract control.tar.gz to the full extraction path */
-	deb_extract(dpkg_deb_control, tmp_name, pkg->file);
+	deb_extract(pkg->file, dpkg_deb_control, tmp_name);
 
 	/* parse the extracted control file */
 	strcat(tmp_name, "/control");
diff --git a/archival/dpkg_deb.c b/archival/dpkg_deb.c
index 450b04b..3cdd4ff 100644
--- a/archival/dpkg_deb.c
+++ b/archival/dpkg_deb.c
@@ -68,7 +68,7 @@
 			strcpy(target_dir, argv[optind + 1]);
 		}
 	}
-	deb_extract(optflag, target_dir, argv[optind]);
+	deb_extract(argv[optind], optflag, target_dir);
 /*	else if (optflag & dpkg_deb_info) {
 		extract_flag = TRUE;
 		extract_to_stdout = TRUE;
